[GRASS-SVN] r62400 - grass/trunk/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Oct 26 18:14:40 PDT 2014


Author: hcho
Date: 2014-10-26 18:14:40 -0700 (Sun, 26 Oct 2014)
New Revision: 62400

Modified:
   grass/trunk/lib/gis/ls_filter.c
Log:
wc2regex: Fix backslash escape

Modified: grass/trunk/lib/gis/ls_filter.c
===================================================================
--- grass/trunk/lib/gis/ls_filter.c	2014-10-27 01:06:41 UTC (rev 62399)
+++ grass/trunk/lib/gis/ls_filter.c	2014-10-27 01:14:40 UTC (rev 62400)
@@ -84,6 +84,11 @@
     for (p = pat; p && *p; p++) {
 	switch (*p) {
 	case '\\':
+	    add(buf, '\\');
+	    if (!*++p)
+		return 0;
+	    add(buf, *p);
+	    break;
 	case '.':
 	case '|':
 	case '(':
@@ -116,15 +121,13 @@
 		add(buf, ',');
 	    break;
 	case '[':
-	    p = do_set(buf, p);
+	    if (!(p = do_set(buf, p)))
+		return 0;
 	    break;
 	default:
 	    add(buf, *p);
 	    break;
 	}
-
-	if (!p)
-	    return 0;
     }
 
     if (!p)



More information about the grass-commit mailing list