aboutsummaryrefslogtreecommitdiff
path: root/libbb/lineedit.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * libbb/lineedit: implement optional Ctrl-R history searchDenys Vlasenko2011-07-111-12/+153
| | | | | | | | | | | | | | | | | | | | | | function old new delta read_line_input 3433 3957 +524 load_string 77 90 +13 input_tab 1086 1069 -17 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 537/-17) Total: 520 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge commit '56a3b82e9692a25ef9c9269e88feac0d579ce8e8' into mergeRon Yorston2012-03-221-9/+15
|\| | | | | | | | | | | | | Conflicts: coreutils/ls.c include/platform.h libbb/bb_basename.c
| * lineedit: fix rare SEGV; mark a few FIXMEsAlexey Fomenko2011-05-201-9/+15
| | | | | | | | | | Signed-off-by: Alexey Fomenko <ext-alexey.fomenko@nokia.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge commit 'b83c9704128dd106071184e4b00335a3b8486857' into mergeRon Yorston2012-03-221-60/+92
|\|
| * small fix for HISTFILESIZEDenys Vlasenko2011-03-311-0/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash,hush: optional support for $HISTFILESIZE.Denys Vlasenko2011-03-311-15/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | Based on patch from Alexey Fomenko (ext-alexey.fomenko AT nokia.com) function old new delta size_from_HISTFILESIZE - 44 +44 hush_main 998 1025 +27 ash_main 1348 1374 +26 read_line_input 3361 3372 +11 new_line_input_t 17 24 +7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: fixes for CONFIG_UNICODE_USING_LOCALE=yDenys Vlasenko2011-03-271-45/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta load_string 45 91 +46 save_string 40 82 +42 reinit_unicode 34 61 +27 BB_PUTCHAR 97 120 +23 init_unicode 17 37 +20 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/0 up/down: 158/0) Total: 158 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge commit 'da4441c44f6efccb6f7b7588404d9c6bfb7b6af8' into mergeRon Yorston2012-03-221-7/+5
|\| | | | | | | | | | | | | Conflicts: libbb/vfork_daemon_rexec.c networking/wget.c procps/ps.c
| * ash: fix TMOUT not restoring tty attributesDenys Vlasenko2011-02-081-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta pgetc 420 500 +80 readtoken1 3202 3239 +37 read_line_input 3316 3337 +21 udhcpc_main 2610 2630 +20 file_get 266 272 +6 expandarg 958 963 +5 localcmd 257 259 +2 addLines 85 87 +2 read_line 94 95 +1 ed_main 2540 2541 +1 timed_out 1 - -1 lineedit_read_key 256 255 -1 alrm_sighandler 44 - -44 cmdloop 539 434 -105 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 10/2 up/down: 175/-151) Total: 24 bytes text data bss dec hex filename 887379 936 17200 905515 dd12b busybox_old 887411 936 17192 905539 dd143 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge remote-tracking branch 'upstream/master'Nguyễn Thái Ngọc Duy2011-01-041-36/+63
|\|
| * lineedit: fix tab-completion of filenames with spacesMike Shal2010-11-221-22/+45
| | | | | | | | | | | | | | | | | | | | | | | | Using ash in busybox git version dea28e1e, tab completion doesn't seem to work properly for filenames that have special characters (such as spaces) in them. For example, with filenames "foo bar" and "foo zap", typing "ls fo<TAB>" correctly expands to "ls foo\ ", but then continuing to type "b<TAB>" will produce "ls foo\ bbar", which is not correct (the 'b' is duplicated). Signed-off-by: Mike Shal <marfey@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: create history files with mode 0600Wolfram Sang2010-11-151-5/+7
| | | | | | | | | | Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * *: use _exit() in sighandlers; showkey: do not use exit-thru-sighandlerMarek Polacek2010-10-281-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | While at it, make ESC sequences more readable; and removed check for isatty(stdin) in reset. Code shrink: text data bss dec hex filename 884771 936 17216 902923 dc70b busybox_old 884723 936 17216 902875 dc6db busybox_unstripped Signed-off-by: Marek Polacek <mmpolacek@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: lineedit: make read_key() pass Ctrl+<letter> to read_line_inputNguyễn Thái Ngọc Duy2010-09-221-0/+2
| | | | | | | | | | | | This makes ^C and ^D work properly regarding ash input handling (i.e. does not crash ash). Pressing ^C in ash does not stop running programs though.
* | win32: lineedit: initialize initial_settingsNguyễn Thái Ngọc Duy2010-09-221-0/+1
| | | | | | | | | | initial_settings.c_cc[] is used to detect Ctrl-C, Ctrl-D. Don't let garbage drive read_line_input()
* | win32: lineedit: fallback to fgets if a tty is not foundNguyễn Thái Ngọc Duy2010-09-211-2/+4
| |
* | Merge remote branch 'origin/master'Nguyễn Thái Ngọc Duy2010-09-141-366/+376
|\|
| * lineedit: do not hang on error, but return error indicator.Denys Vlasenko2010-09-071-6/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
| * lineedit: on tab completion, show filenames obly in all cases (bash compat)Denys Vlasenko2010-09-031-13/+9
| | | | | | | | | | | | | | function old new delta complete_cmd_dir_file 731 730 -1 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
| * lineedit: allocate matchBuf only temporarily: saves MAX_LINELEN bytesDenys Vlasenko2010-09-031-45/+48
| | | | | | | | | | | | | | | | | | | | function old new delta input_tab 1027 1041 +14 build_match_prefix 590 562 -28 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 14/-28) Total: -14 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
| * lineedit: de-indent large block in input_tab. No logic changes.Denys Vlasenko2010-09-031-131/+131
| | | | | | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
| * lineedit: rename tmp -> chosen_match; small code shrinkDenys Vlasenko2010-09-031-26/+23
| | | | | | | | | | | | | | function old new delta input_tab 1016 1012 -4 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
| * lineedit: stop using permanent int_buf[] (16k!): allocate itDenys Vlasenko2010-09-031-14/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Now it is allocated temporarily only for the duretion of prefix generation, and also we only allocate the needed size, not maximally possible. function old new delta build_match_prefix 579 590 +11 remove_chunk 43 28 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 11/-15) Total: -4 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
| * lineedit: remove pos_buf[] array (up to 16k!); fix compat bugsDenys Vlasenko2010-09-031-83/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pos_buf is a strange hack, easy to do without it. This also allows lines >32k long to be handled. Also simplified match prefix generations and made behavior more like bash. function old new delta remove_chunk - 43 +43 collapse_pos 79 - -79 build_match_prefix 804 579 -225 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/1 up/down: 43/-304) Total: -261 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
| * lineedit: return prefix len from tab completion helpersDenys Vlasenko2010-09-031-36/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This kills horrific logic which deletes and re-adds prefix (!) function old new delta complete_cmd_dir_file 705 731 +26 complete_username 121 124 +3 input_tab 1041 1016 -25 build_match_prefix 838 804 -34 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 29/-59) Total: -30 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
| * lineedit: clean up tab completion code (variable reuse, comments)Denys Vlasenko2010-09-031-69/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Noted bugs in behavior. Added debugging machinery. Decoupled variables reused for unrelated purposes: apparently, when not forced to use liveness analysis, gcc fares better. function old new delta complete_cmd_dir_file 699 705 +6 collapse_pos 75 79 +4 build_match_prefix 892 838 -54 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 10/-54) Total: -44 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
| * preparatory cleanup patch for tab completion fixesDenys Vlasenko2010-09-031-61/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | renames and deinlines a few functions function old new delta input_tab - 1041 +1041 complete_cmd_dir_file - 699 +699 complete_username - 121 +121 username_completion 121 - -121 read_line_input 5002 3313 -1689 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 0/1 up/down: 1861/-1810) Total: 51 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
| * lineedit: small readability improvement (same code)Denys Vlasenko2010-09-021-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
| * lineedit: fix completion with Unicode charsDenys Vlasenko2010-09-021-3/+13
| | | | | | | | | | | | | | | | | | | | function old new delta read_line_input 4966 5002 +36 bb_wcstombs 170 159 -11 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 36/-11) Total: 25 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
| * lineedit: preparatory cleanup patch for Unicode completion fixDenys Vlasenko2010-09-021-113/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some logic changes and function renames. The fix will follow this patch, to mkae it distinct from cleanup. function old new delta build_match_prefix - 892 +892 username_completion - 121 +121 read_line_input 4902 4966 +64 username_tab_completion 235 - -235 find_match 892 - -892 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 1/0 up/down: 1077/-1127) Total: -50 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* | Merge branch 'origin/master' (early part)Nguyễn Thái Ngọc Duy2010-09-141-26/+26
|\|
| * lineedit: mostly revert recent wrong logic in "ask terminal" codeDenys Vlasenko2010-07-251-12/+9
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: limit ASK_TERMINAL to the case when we can't find out the widthDenys Vlasenko2010-07-181-9/+14
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: cosmetics, no code changesDenys Vlasenko2010-07-181-26/+24
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'origin/master' (early part)Nguyễn Thái Ngọc Duy2010-09-141-3/+6
|\|
| * lineedit: fix column display for wide and combining chars in TAB completionTomas Heinrich2010-06-011-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta unicode_strwidth - 20 +20 read_line_input 4945 4953 +8 unicode_strlen 31 - -31 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 1/0 up/down: 28/-31) Total: -3 bytes Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'origin/master' (early part)Nguyễn Thái Ngọc Duy2010-09-141-106/+214
|\|
| * typo fixDenys Vlasenko2010-05-171-2/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: fix insertion deep inside line (*several lines* before end)Denys Vlasenko2010-05-171-8/+15
| | | | | | | | | | | | | | function old new delta input_backward 212 229 +17 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: trivial simplifications. -7 bytesDenys Vlasenko2010-05-171-14/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: fix moving backwards across lines with wide charsDenys Vlasenko2010-05-171-21/+46
| | | | | | | | | | | | | | function old new delta input_backward 212 208 -4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * consolidate ESC sequencesDenys Vlasenko2010-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta bell 2 - -2 CMdown 2 - -2 Ceos 4 - -4 Ceol 4 - -4 CMup 4 - -4 SOs 5 - -5 SOn 5 - -5 CMrc 9 - -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * stop using LAST_SUPPORTED_WCHAR and CONFIG_LAST_SUPPORTED_WCHAR, it's confusingDenys Vlasenko2010-05-161-3/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: partially fix wide and combining chars editingTomas Heinrich2010-05-161-44/+80
| | | | | | | | | | Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: change how cmdedit_set_out_char worksDenys Vlasenko2010-05-111-32/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename two badly names functions, use "clear to end of screen" to eliminate annoying problems with clearing wide/combining chars, and such. Run tested. function old new delta put_cur_glyph_and_inc_cursor - 124 +124 put_till_end_and_adv_cursor - 24 +24 input_delete 125 130 +5 Ceos 5 4 -1 Ceol 5 4 -1 input_end 24 - -24 cmdedit_set_out_char 122 - -122 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 1/2 up/down: 153/-148) Total: 5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb/lineedit: add support for preserving "broken" (non-unicode) charsTomas Heinrich2010-04-291-11/+51
| | | | | | | | | | Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: lineedit: split $PATH the Windows wayNguyễn Thái Ngọc Duy2010-09-141-0/+8
| |
* | win32: lineedit: do not attempt to tc[sg]etattr in Windows consoleNguyễn Thái Ngọc Duy2010-09-141-0/+2
|/
* unicode: s/FEATURE_ASSUME_UNICODE/UNICODE_SUPPORT, add UNICODE_USING_LOCALEDenys Vlasenko2010-03-261-13/+13
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* unicode: optional table for better handling of neutral bidi charsTomas Heinrich2010-03-261-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Off: function old new delta unicode_bidi_isrtl - 55 +55 isrtl_str 51 65 +14 unicode_isrtl 55 - -55 read_line_input 5003 4937 -66 ------------------------------------------------------------------------------ (add/remove: 1/4 grow/shrink: 1/1 up/down: 69/-121) Total: -52 bytes On: function old new delta static.neutral_b - 320 +320 static.neutral_p - 142 +142 unicode_bidi_isrtl - 55 +55 unicode_bidi_is_neutral_wchar - 55 +55 isrtl_str 51 59 +8 unicode_isrtl 55 - -55 read_line_input 5003 4937 -66 ------------------------------------------------------------------------------ (add/remove: 4/4 grow/shrink: 1/1 up/down: 580/-121) Total: 459 bytes Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>