Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
McDutchie committed Dec 27, 2024
1 parent af827c9 commit 382350a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/ksh93/tests/libcmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ if builtin dirname 2> /dev/null; then
# PATH_LEADING_SLASHES handling; multiple operands
exp=$'/\n//\n//\n//\n//\n//server\n//server'
got=$(export _AST_FEATURES='PATH_LEADING_SLASHES - 1'
"$SHELL" -c 'builtin dirname && dirname / // // //server ///server //server/name ///server//name' 2>&1)
"$SHELL" -c 'builtin dirname && dirname / // // //server ///server //server/name ///server//name')
[[ $got == "$exp" ]] || err_exit "PATH_LEADING_SLASHES handling (expected $(printf %q "$exp"), got $(printf %q "$got"))"
fi

Expand Down
1 change: 1 addition & 0 deletions src/lib/libcmd/dirname.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ static void l_dirname(Sfio_t *outfile, const char *pathname, char termch)
while(pathname[2]=='/' && pathname<last)
pathname++;
/* skip first '/' if PATH_LEADING_SLASHES not set */
error(ERROR_warn(0),"[DEBUG] <%s><%s>: %d,%d,%d,<%s>", pathname, last, last!=pathname, pathname[0]=='/', pathname[1]=='/', astconf("PATH_LEADING_SLASHES",NULL,NULL));
if(last!=pathname && pathname[0]=='/' && pathname[1]=='/' && *astconf("PATH_LEADING_SLASHES",NULL,NULL)!='1')
pathname++;
}
Expand Down

0 comments on commit 382350a

Please sign in to comment.