diff options
author | 2018-04-13 15:21:13 -0500 | |
---|---|---|
committer | 2018-04-13 15:21:13 -0500 | |
commit | 3a48dc4373d65bf1203da4899b4dc2bc17993a26 (patch) | |
tree | b340497ef025415ddf058d0a74bf4548ec280c45 | |
parent | 691a2304c8c29a3b7d5977908ef82aaf188f5ba0 (diff) | |
download | pseudo-3a48dc4373d65bf1203da4899b4dc2bc17993a26.tar.gz pseudo-3a48dc4373d65bf1203da4899b4dc2bc17993a26.tar.bz2 pseudo-3a48dc4373d65bf1203da4899b4dc2bc17993a26.zip |
Fix one more stray slash
After the rest of the restandardization on "path does not have
to be slash-terminated", I missed the case where you get an absolute
symlink, which could result in a path starting with an extra slash.
Signed-off-by: Seebs <seebs@seebs.net>
-rw-r--r-- | ChangeLog.txt | 2 | ||||
-rw-r--r-- | pseudo_util.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index 6d91bb3..36a1927 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -5,6 +5,8 @@ to take a 0 to indicate "always debug", because we want that message unconditionally, and I don't want near-identical calls to diag() and debug(). + * (seebs) Fix a lurking stray slash that could happen while + resolving absolute symlinks. 2018-04-02: * (seebs) Change default copyright notice in guts to diff --git a/pseudo_util.c b/pseudo_util.c index a5e68f1..b46417d 100644 --- a/pseudo_util.c +++ b/pseudo_util.c @@ -706,7 +706,7 @@ pseudo_append_element(char *newpath, char *root, size_t allocated, char **pcurre linkbuf[linklen] = '\0'; /* absolute symlink means start over! */ if (*linkbuf == '/') { - current = newpath + 1; + current = newpath; } else { /* point back at the end of the previous path... */ current -= (elen + 1); |