aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-03-15 10:07:14 +0000
committerRon Yorston <rmy@pobox.com>2019-03-15 10:07:14 +0000
commit79c85ec59075b5ead415a4713bd72445546dcf8e (patch)
tree614d5f43da34da207de8be08d186cf78169cf859 /libbb
parentec02b825d05d814800558995e2f28513de80206b (diff)
downloadbusybox-w32-79c85ec59075b5ead415a4713bd72445546dcf8e.tar.gz
busybox-w32-79c85ec59075b5ead415a4713bd72445546dcf8e.tar.bz2
busybox-w32-79c85ec59075b5ead415a4713bd72445546dcf8e.zip
lineedit: add a command to change backslashes to slashes
When a path name is copied to a console application using drag and drop the path separator is backslash. To handle this situation in the shell add an editing command (Ctrl-Z) to convert all backslashes on the current line to slashes. See GitHub issue #149. Also remove some unused code from read_key().
Diffstat (limited to 'libbb')
-rw-r--r--libbb/lineedit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 95f92aa75..abe2857b2 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -2608,6 +2608,13 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman
2608 input_tab(&lastWasTab); 2608 input_tab(&lastWasTab);
2609 break; 2609 break;
2610#endif 2610#endif
2611#if ENABLE_PLATFORM_MINGW32
2612 case CTRL('Z'):
2613 command_ps[command_len] = '\0';
2614 convert_slashes(command_ps);
2615 redraw(cmdedit_y, 0);
2616 break;
2617#endif
2611 case CTRL('K'): 2618 case CTRL('K'):
2612 /* Control-k -- clear to end of line */ 2619 /* Control-k -- clear to end of line */
2613 command_ps[cursor] = BB_NUL; 2620 command_ps[cursor] = BB_NUL;