Diff of /src/hugin_base/hugin_utils/platform.h [6cdbff] .. [d5c5e9]  Maximize  Restore

Switch to side-by-side view

--- a/src/hugin_base/hugin_utils/platform.h
+++ b/src/hugin_base/hugin_utils/platform.h
@@ -70,13 +70,14 @@
         for (size_t i = 0; i < len; i++) {
             str source(replacements.substr(i,1));
             str dest(quotechar + source);
+            size_t destlen = dest.size();
             size_t idx = 0;
             do {
                 idx = ret.find(source,idx);
                 if (idx != str::npos) {
                     ret.replace(idx, 1, dest);
                     // skip to next unknown char.
-                    idx += 2;
+                    idx += destlen;
                 }
             } while (idx != str::npos);
         }
@@ -102,7 +103,14 @@
         return quoteStringInternal(arg, str("\\"), str("\\ ~$\"|'`{}[]()"));
     #endif
     }
-    
+
+    /** Escape dangerous chars in makefile strings/filenames (space and wildcard characters) */
+    template <class str>
+    str escapeStringMake(const str & arg)
+    {
+        return quoteStringInternal(arg, str("\\"), str(" $*?"));
+    }
+
     /** Quote a filename, so that it is surrounded by ""
      *
      *  @BUG I don't know the escape char for windows

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks