This finds the first non-'/'. Since the first character is a '/' (we have set that a few lines above in `*slash = '/';`), we were manually skipping it. However, that's unnecessary, since the function will similarly skip it.
It seems a benign off-by-one mental bug, which didn't result in any actual bug, but still worth "fixing", or rather, simplifying. Fixes: 6528cac57d99 (2005-01-22; "* modules/chdir-long (Depends-on): Remove mempcpy.") Cc: Paul Eggert <[email protected]> Signed-off-by: Alejandro Colomar <[email protected]> --- Hi! I haven't tested this. I found it while working on the stpspn() patches. Have a lovely day! Alex lib/chdir-long.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/chdir-long.c b/lib/chdir-long.c index aa5791b9b281..c3846dfee614 100644 --- a/lib/chdir-long.c +++ b/lib/chdir-long.c @@ -147,7 +147,7 @@ chdir_long (char *dir) *slash = '/'; if (err != 0) goto Fail; - dir = find_non_slash (slash + 1); + dir = find_non_slash (slash); } else if (n_leading_slash) { @@ -178,7 +178,7 @@ chdir_long (char *dir) if (err != 0) goto Fail; - dir = find_non_slash (slash + 1); + dir = find_non_slash (slash); } if (dir < dir_end) -- 2.51.0
