Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'nd/maint-relative' into maint
author
Junio C Hamano
<gitster@pobox.com>
Wed, 19 Jan 2011 16:25:31 +0000
(08:25 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 19 Jan 2011 16:25:31 +0000
(08:25 -0800)
* nd/maint-relative:
get_cwd_relative(): do not misinterpret root path
dir.c
patch
|
blob
|
history
raw
(from parent 1:
3f14246
)
diff --git
a/dir.c
b/dir.c
index b2dfb69eb5606a7538cc5e1876a91f703ec4969c..b68750450cdec89df9ea7595ab9a7022619e6e58 100644
(file)
--- a/
dir.c
+++ b/
dir.c
@@
-965,6
+965,12
@@
char *get_relative_cwd(char *buffer, int size, const char *dir)
case '/':
return cwd + 1;
default:
+ /*
+ * dir can end with a path separator when it's root
+ * directory. Return proper prefix in that case.
+ */
+ if (dir[-1] == '/')
+ return cwd;
return NULL;
}
}