On 15/01/2015 21:18, Angelo Calafato wrote:
> My question is: would not be better that global handles any type of
> separators when evaluating the --from-here option?
Indeed it would. Here's a new global.exe
<http://global.adoxa.vze.com/global.zip> to fix it; the patch is attached.
--
Jason.
diff -urp global-6.3.3/libutil/abs2rel.c global-6.3-3/libutil/abs2rel.c
--- global-6.3.3/libutil/abs2rel.c 2014-11-26 12:49:36 +1000
+++ global-6.3-3/libutil/abs2rel.c 2015-01-17 10:22:12 +1000
@@ -36,6 +36,9 @@
#include "locatestring.h"
#include "strlimcpy.h"
#include "path.h"
+#if defined(_WIN32) || defined(__DJGPP__)
+#include "checkalloc.h"
+#endif
#define COLOR_PATH
#ifdef COLOR_PATH
@@ -261,6 +264,15 @@ normalize_pathname(const char *path, cha
const char *savep, *p = path;
char *final, *q = result;
char *endp = result + size - 1;
+#if defined(_WIN32) || defined(__DJGPP__)
+ char *spath = check_strdup(path), *pp = spath;
+ while (*pp) {
+ if (*pp == '\\')
+ *pp = '/';
+ ++pp;
+ }
+ p = spath;
+#endif
/* accept the first '/' */
if (isabspath(p)) {
@@ -325,9 +337,15 @@ normalize_pathname(const char *path, cha
}
}
*q = '\0';
+#if defined(_WIN32) || defined(__DJGPP__)
+ free(spath);
+#endif
return result;
erange:
errno = ERANGE;
+#if defined(_WIN32) || defined(__DJGPP__)
+ free(spath);
+#endif
return NULL;
}
/**
_______________________________________________
Bug-global mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-global