Hello,
since 0.8 is out I think I can bring back some of my patches. This one
changes backslash delimiter (\) on windows to forward slash (/) in
makefile. It should fix test target on windows. Because I don't have
access windows build machine I kindly ask for testing.

Lukáš

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/hugin-ptx
-~----------~----~----~----~------~----~------~--~---

Index: src/hugin_base/hugin_utils/platform.h
===================================================================
--- src/hugin_base/hugin_utils/platform.h	(revision 4012)
+++ src/hugin_base/hugin_utils/platform.h	(working copy)
@@ -84,6 +84,21 @@
         return ret;
     }
 
+    /// utility function; replaces find with replacement.
+    template <class str>
+    str replaceStringInternal(const str & arg, const str & replacement,
+                            const str & find)
+    {
+        str ret(arg);
+        size_t idx = 0;
+        do {
+            idx = ret.find(find,idx);
+            if (idx != str::npos) {
+                ret.replace(idx, 1, replacement);
+            }
+        } while (idx != str::npos);
+        return ret;
+    }
     
     /** Try to escape special chars on windows and linux.
      *
@@ -118,10 +133,12 @@
     str quoteStringShell(const str & arg)
     {
 #ifdef WIN32
+        // Replace backslash with slash. Otherwise it could make problems to make.
+        str replaced(replaceStringInternal(arg, str("/"), str("\\")));
         // Do not quote backslash,: and ~ on win32.
         // It seems to be handled well by sh.exe from unixutils
         // Escape ^. It shouldn't be necessary, but otherwise folders starting with ^ will not work
-        return quoteStringInternal(quoteStringInternal(arg, str("\\"), str(" $\"|'`{}[]()*#=^")), str("$"), str("$"));
+        return quoteStringInternal(quoteStringInternal(replaced, str("\\"), str(" $\"|'`{}[]()*#=^")), str("$"), str("$"));
 #else
         return quoteStringInternal(quoteStringInternal(arg, str("\\"), str("\\ ~$\"|'`{}[]()*#:=")), str("$"), str("$"));
 #endif

Reply via email to