diff options
author | Ron Yorston <rmy@pobox.com> | 2020-08-23 10:16:12 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2020-08-23 10:16:12 +0100 |
commit | 64ecd10486934c12336dac84c67a1939dce0e096 (patch) | |
tree | 73e8bc6b07176b84295fd07f19828292a240f693 /include | |
parent | d6b557547551dd80a389f361a995a97ef5930a63 (diff) | |
download | busybox-w32-64ecd10486934c12336dac84c67a1939dce0e096.tar.gz busybox-w32-64ecd10486934c12336dac84c67a1939dce0e096.tar.bz2 busybox-w32-64ecd10486934c12336dac84c67a1939dce0e096.zip |
win32: code shrink Unix-style path handling
Replace auto_add_system_drive() with alloc_system_drive() which
leaves space for a possible filename extension. This makes it
possible to drop alloc_win32_extension() and auto_win32_extension().
Saves 144 bytes.
Diffstat (limited to 'include')
-rw-r--r-- | include/mingw.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/include/mingw.h b/include/mingw.h index b34d8772c..79cf6c783 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -521,16 +521,8 @@ void init_codepage(void); | |||
521 | int has_bat_suffix(const char *p); | 521 | int has_bat_suffix(const char *p); |
522 | int has_exe_suffix(const char *p); | 522 | int has_exe_suffix(const char *p); |
523 | int has_exe_suffix_or_dot(const char *name); | 523 | int has_exe_suffix_or_dot(const char *name); |
524 | char *alloc_win32_extension(const char *p); | ||
525 | int add_win32_extension(char *p); | 524 | int add_win32_extension(char *p); |
526 | 525 | ||
527 | static inline char *auto_win32_extension(const char *p) | ||
528 | { | ||
529 | extern char *auto_string(char *str) FAST_FUNC; | ||
530 | char *s = alloc_win32_extension(p); | ||
531 | return s ? auto_string(s) : NULL; | ||
532 | } | ||
533 | |||
534 | char *bs_to_slash(char *p) FAST_FUNC; | 526 | char *bs_to_slash(char *p) FAST_FUNC; |
535 | void slash_to_bs(char *p) FAST_FUNC; | 527 | void slash_to_bs(char *p) FAST_FUNC; |
536 | size_t remove_cr(char *p, size_t len) FAST_FUNC; | 528 | size_t remove_cr(char *p, size_t len) FAST_FUNC; |
@@ -548,7 +540,7 @@ int unc_root_len(const char *dir); | |||
548 | int root_len(const char *path); | 540 | int root_len(const char *path); |
549 | const char *get_system_drive(void); | 541 | const char *get_system_drive(void); |
550 | const char *need_system_drive(const char *path); | 542 | const char *need_system_drive(const char *path); |
551 | char *auto_add_system_drive(const char *path); | 543 | char *alloc_system_drive(const char *path); |
552 | int chdir_system_drive(void); | 544 | int chdir_system_drive(void); |
553 | char *xabsolute_path(char *path); | 545 | char *xabsolute_path(char *path); |
554 | char *get_drive_cwd(const char *path, char *buffer, int size); | 546 | char *get_drive_cwd(const char *path, char *buffer, int size); |