diff options
author | Ron Yorston <rmy@pobox.com> | 2021-03-01 09:20:58 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2021-03-01 09:20:58 +0000 |
commit | b2ea5c74c8e2a26f9d9e8978d41a2368693e5ff7 (patch) | |
tree | 93bafe054a07f805ec2d0d17f930328001710c56 /win32 | |
parent | aa1512610a7d5081f0b721e7dc24a95527c07a95 (diff) | |
download | busybox-w32-b2ea5c74c8e2a26f9d9e8978d41a2368693e5ff7.tar.gz busybox-w32-b2ea5c74c8e2a26f9d9e8978d41a2368693e5ff7.tar.bz2 busybox-w32-b2ea5c74c8e2a26f9d9e8978d41a2368693e5ff7.zip |
win32: move is_absolute_path()
Make is_absolute_path() a function rather than a macro and move it
from ash.c into mingw.c.
Diffstat (limited to 'win32')
-rw-r--r-- | win32/mingw.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index 6e1dc6a9a..c9b72ae98 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -1922,3 +1922,12 @@ int has_path(const char *file) | |||
1922 | return strchr(file, '/') || strchr(file, '\\') || | 1922 | return strchr(file, '/') || strchr(file, '\\') || |
1923 | has_dos_drive_prefix(file); | 1923 | has_dos_drive_prefix(file); |
1924 | } | 1924 | } |
1925 | |||
1926 | /* This function is misnamed. It's actually a test for 'is not a path | ||
1927 | * relative to the current working directory'. On Unix this is the | ||
1928 | * same as 'is an absolute path' but Windows also has paths relative to | ||
1929 | * current root and relative to current directory of another drive. */ | ||
1930 | int is_absolute_path(const char *path) | ||
1931 | { | ||
1932 | return path[0] == '/' || path[0] == '\\' || has_dos_drive_prefix(path); | ||
1933 | } | ||