diff options
| -rw-r--r-- | libbb/find_mount_point.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/libbb/find_mount_point.c b/libbb/find_mount_point.c index c16f9e087..cf06c6e18 100644 --- a/libbb/find_mount_point.c +++ b/libbb/find_mount_point.c | |||
| @@ -32,7 +32,6 @@ struct mntent* FAST_FUNC find_mount_point(const char *name, int subdir_too) | |||
| 32 | static struct mntdata *data = NULL; | 32 | static struct mntdata *data = NULL; |
| 33 | char *current; | 33 | char *current; |
| 34 | const char *path; | 34 | const char *path; |
| 35 | DWORD len; | ||
| 36 | #endif | 35 | #endif |
| 37 | 36 | ||
| 38 | if (stat(name, &s) != 0) | 37 | if (stat(name, &s) != 0) |
| @@ -93,13 +92,8 @@ struct mntent* FAST_FUNC find_mount_point(const char *name, int subdir_too) | |||
| 93 | 92 | ||
| 94 | if ( isalpha(name[0]) && name[1] == ':' ) { | 93 | if ( isalpha(name[0]) && name[1] == ':' ) { |
| 95 | path = name; | 94 | path = name; |
| 96 | } | 95 | } else { |
| 97 | else { | 96 | path = current = xrealloc_getcwd_or_warn(NULL); |
| 98 | if ( (len=GetCurrentDirectory(0, NULL)) > 0 && | ||
| 99 | (current=malloc(len+1)) != NULL && | ||
| 100 | GetCurrentDirectory(len, current) ) { | ||
| 101 | path = current; | ||
| 102 | } | ||
| 103 | } | 97 | } |
| 104 | 98 | ||
| 105 | if ( path && isalpha(path[0]) && path[1] == ':' ) { | 99 | if ( path && isalpha(path[0]) && path[1] == ':' ) { |
