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)
123
123
{
124
124
static char buf [PATH_MAX + 1 ];
125
125
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 )) {
127
129
if (strlcpy (buf , path , PATH_MAX ) >= PATH_MAX )
128
130
die ("Too long path: %.*s" , 60 , path );
129
131
} else {
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ test_expect_success 'strip_path_suffix' '
140
140
c:/msysgit/libexec//git-core libexec/git-core)
141
141
'
142
142
143
- test_expect_failure ' absolute path rejects the empty string' '
143
+ test_expect_success ' absolute path rejects the empty string' '
144
144
test_must_fail test-path-utils absolute_path ""
145
145
'
146
146
You can’t perform that action at this time.
0 commit comments