+2025-05-05 Bruno Haible <bruno@clisp.org>
+
+ windows-cygpath: Make it work with the native Windows 'git' port.
+ * lib/windows-cygpath.c (windows_cygpath_w): When we don't invoke
+ cygpath, still convert slashes to backslashes.
+
2025-05-05 Bruno Haible <bruno@clisp.org>
vc-mtime: Another fix for native Windows.
return line;
}
else
- /* It's a relative file name, or an absolute native Windows file name.
- No conversion is needed. */
- return xstrdup (filename);
+ {
+ /* It's a relative file name, or an absolute native Windows file name.
+ All we need to do is to convert slashes to backslahes, e.g.
+ 'C:/Users' -> 'C:\Users'. */
+ size_t len = strlen (filename) + 1;
+ char *copy = XNMALLOC (len, char);
+ for (size_t i = 0; i < len; i++)
+ copy[i] = (filename[i] == '/' ? '\\' : filename[i]);
+ return copy;
+ }
}
#else