File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,9 @@ const char *absolute_path(const char *path)
123123{
124124 static char buf [PATH_MAX + 1 ];
125125
126- if (is_absolute_path (path )) {
126+ if (!* path ) {
127+ die ("The empty string is not a valid path" );
128+ } else if (is_absolute_path (path )) {
127129 if (strlcpy (buf , path , PATH_MAX ) >= PATH_MAX )
128130 die ("Too long path: %.*s" , 60 , path );
129131 } else {
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ test_expect_success 'strip_path_suffix' '
140140 c:/msysgit/libexec//git-core libexec/git-core)
141141'
142142
143- test_expect_failure ' absolute path rejects the empty string' '
143+ test_expect_success ' absolute path rejects the empty string' '
144144 test_must_fail test-path-utils absolute_path ""
145145'
146146
You can’t perform that action at this time.
0 commit comments