aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-03-15 10:27:19 +0000
committerRon Yorston <rmy@pobox.com>2019-03-15 10:27:19 +0000
commit996f93243dda87de3140c497624312722f47ffa1 (patch)
tree8c894b5b7414cbd72f02bd309d54ffa62283915a /libbb
parent79c85ec59075b5ead415a4713bd72445546dcf8e (diff)
downloadbusybox-w32-996f93243dda87de3140c497624312722f47ffa1.tar.gz
busybox-w32-996f93243dda87de3140c497624312722f47ffa1.tar.bz2
busybox-w32-996f93243dda87de3140c497624312722f47ffa1.zip
win32: add function to convert slashes to backslashes
There are now two places where slashes are converted to backslashes throughout a string so it makes sense to create a function to do this. To avoid confusion rename convert_slashes() to bs_to_slash() and call the new function slash_to_bs().
Diffstat (limited to 'libbb')
-rw-r--r--libbb/appletlib.c2
-rw-r--r--libbb/lineedit.c2
-rw-r--r--libbb/make_directory.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 49ae35874..35aabe758 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -1287,7 +1287,7 @@ int main(int argc UNUSED_PARAM, char **argv)
1287 char *s; 1287 char *s;
1288 1288
1289 str_tolower(argv[0]); 1289 str_tolower(argv[0]);
1290 convert_slashes(argv[0]); 1290 bs_to_slash(argv[0]);
1291 if (has_exe_suffix_or_dot(argv[0]) && (s=strrchr(argv[0], '.'))) { 1291 if (has_exe_suffix_or_dot(argv[0]) && (s=strrchr(argv[0], '.'))) {
1292 *s = '\0'; 1292 *s = '\0';
1293 } 1293 }
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index abe2857b2..3725dba0d 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -2611,7 +2611,7 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman
2611#if ENABLE_PLATFORM_MINGW32 2611#if ENABLE_PLATFORM_MINGW32
2612 case CTRL('Z'): 2612 case CTRL('Z'):
2613 command_ps[command_len] = '\0'; 2613 command_ps[command_len] = '\0';
2614 convert_slashes(command_ps); 2614 bs_to_slash(command_ps);
2615 redraw(cmdedit_y, 0); 2615 redraw(cmdedit_y, 0);
2616 break; 2616 break;
2617#endif 2617#endif
diff --git a/libbb/make_directory.c b/libbb/make_directory.c
index ef0a8acd8..9af5552d5 100644
--- a/libbb/make_directory.c
+++ b/libbb/make_directory.c
@@ -51,7 +51,7 @@ int FAST_FUNC bb_make_directory(char *path, long mode, int flags)
51 org_mask = cur_mask = (mode_t)-1L; 51 org_mask = cur_mask = (mode_t)-1L;
52#if ENABLE_PLATFORM_MINGW32 52#if ENABLE_PLATFORM_MINGW32
53 /* normalise path separators, path is already assumed writable */ 53 /* normalise path separators, path is already assumed writable */
54 convert_slashes(path); 54 bs_to_slash(path);
55#endif 55#endif
56 s = path; 56 s = path;
57 while (1) { 57 while (1) {