projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
log10-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
[gnulib.git]
/
lib
/
canonicalize.c
diff --git
a/lib/canonicalize.c
b/lib/canonicalize.c
index
ed094b7
..
583c1a4
100644
(file)
--- a/
lib/canonicalize.c
+++ b/
lib/canonicalize.c
@@
-145,8
+145,12
@@
canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode)
rname_limit = rname + PATH_MAX;
rname[0] = '/';
dest = rname + 1;
rname_limit = rname + PATH_MAX;
rname[0] = '/';
dest = rname + 1;
- if (DOUBLE_SLASH_IS_DISTINCT_ROOT && name[1] == '/' && name[2] != '/')
- *dest++ = '/';
+ if (DOUBLE_SLASH_IS_DISTINCT_ROOT)
+ {
+ if (name[1] == '/' && name[2] != '/')
+ *dest++ = '/';
+ *dest = '\0';
+ }
}
for (start = name; *start; start = end)
}
for (start = name; *start; start = end)
@@
-267,9
+271,12
@@
canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode)
if (buf[0] == '/')
{
dest = rname + 1; /* It's an absolute symlink */
if (buf[0] == '/')
{
dest = rname + 1; /* It's an absolute symlink */
- if (DOUBLE_SLASH_IS_DISTINCT_ROOT
- && buf[1] == '/' && buf[2] != '/')
- *dest++ = '/';
+ if (DOUBLE_SLASH_IS_DISTINCT_ROOT)
+ {
+ if (buf[1] == '/' && buf[2] != '/')
+ *dest++ = '/';
+ *dest = '\0';
+ }
}
else
{
}
else
{