aboutsummaryrefslogtreecommitdiff
path: root/editors/awk.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * getopt32: add new syntax of 'o:+' and 'o:*' for -o NUM and -o LISTDenys Vlasenko2016-07-061-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In many cases, this aqllows to drop use of opt_complementary. Approximately -400 bytes: function old new delta getopt32 1423 1502 +79 opt_string 17 18 +1 OPT_STR 24 25 +1 uniq_main 416 406 -10 timeout_main 279 269 -10 sulogin_main 270 260 -10 readprofile_main 1825 1815 -10 ps_main 543 533 -10 pidof_main 245 235 -10 pgrep_main 611 601 -10 od_main 2600 2590 -10 mkfs_minix_main 2684 2674 -10 mkfs_ext2_main 2603 2593 -10 microcom_main 712 702 -10 makemime_main 315 305 -10 ionice_main 282 272 -10 inetd_main 2074 2064 -10 ifplugd_main 1144 1134 -10 halt_main 353 343 -10 getopt_main 636 626 -10 fdisk_main 2854 2844 -10 env_main 206 196 -10 dmesg_main 319 309 -10 conspy_main 1214 1204 -10 awk_main 981 971 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/22 up/down: 81/-220) Total: -139 bytes text data bss dec hex filename 919373 906 14060 934339 e41c3 busybox_old 918969 906 14060 933935 e402f busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2015-10-131-48/+67
|\|
| * awk: support "length" form of "length()". Closes 8371Denys Vlasenko2015-10-021-48/+67
| | | | | | | | | | | | | | | | function old new delta parse_expr 805 848 +43 tokenlist 447 448 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2015-07-141-12/+0
|\|
| * Removes stray empty line from codeManinder Singh2015-07-131-12/+0
| | | | | | | | | | | | | | | | | | This patch removes stray empty line from busybox code reported by script find_stray_empty_lines Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Akhilesh Kumar <akhilesh.k@samsung.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2014-06-301-0/+2
|\|
| * awk: fix handling of "if ... break ; else ..." - closes 7226Denys Vlasenko2014-06-261-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | awk: treat \r as a space character to skipRon Yorston2014-01-131-0/+4
|/
* awk: fix a bug in argc counting in recent changeDenys Vlasenko2013-11-211-8/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: optionally support -e AWK_PROGSven-Göran Bergh2013-11-121-25/+84
| | | | | | | | function old new delta awk_main 959 978 +19 Signed-off-by: Sven-Göran Bergh <sgb@systemasis.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: fix length(array)Denys Vlasenko2013-10-121-1/+9
| | | | | | | function old new delta evaluate 3526 3548 +22 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: Fix handling of functions with empty bodyBernhard Reutner-Fischer2013-07-311-1/+1
| | | | | | | ammend b79a0fef99627c457548e804fcd6e162b116cbe8 to properly handle functions defined in another scope. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* awk: use "long long" as integer type, not "int"Denys Vlasenko2013-07-201-5/+5
| | | | | | | | | | | | | | Testcase: awk "BEGIN{n=(2^31)-1; print n, int(n), n%1, ++n, int(n), n%1}" 2147483647 2147483647 0 2147483648 2147483648 0 (last three values weren't showing right) function old new delta evaluate 3444 3458 +14 fmt_num 221 230 +9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: Fix handling of functions with empty bodyBernhard Reutner-Fischer2013-03-131-1/+2
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* whitespace cleanup. no code changesDenys Vlasenko2013-01-141-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: fix FS assignment behavior. Closes 5108Denys Vlasenko2012-07-111-0/+12
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: make -F STR interpret escape sequences. Closes 5126Denys Vlasenko2012-06-221-7/+19
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: fix a SEGVDenys Vlasenko2011-09-111-9/+62
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: fix define name collision with BSD headersDenys Vlasenko2011-09-101-0/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: next_input_file can return NULL, don't SEGV in this case.Denys Vlasenko2011-09-071-9/+11
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: remove "Options:" string from help textsDenys Vlasenko2011-06-051-2/+1
| | | | | | | function old new delta packed_usage 28706 28623 -83 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* move help text from include/usage.src.h to debianutils/*.c e2fsprogs/*.c ↵Pere Orga2011-04-031-0/+8
| | | | | | | editors/*.c loginutils/*.c mailutils/*.c Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace cleanupDenys Vlasenko2010-10-291-7/+7
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* awk: reduce ifdef forestRob Landley2010-10-241-33/+32
| | | | | Signed-off-by: Rob Landley <rob@landley.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: fix breakage in last commitDenys Vlasenko2010-10-241-12/+15
| | | | | | | | | | | | | | | While at it, made bb_process_escape_sequence faster (same size) function old new delta nextchar 49 53 +4 bb_process_escape_sequence 138 140 +2 next_token 838 839 +1 static.charmap 20 18 -2 is_assignment 143 135 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/2 up/down: 7/-10) Total: -3 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: fix segfault on closing non-opened fileDenys Vlasenko2010-10-231-86/+96
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: code shrinkDenys Vlasenko2010-10-051-43/+41
| | | | | | | | function old new delta fsrealloc 112 107 -5 next_token 862 844 -18 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* awk: 00.123 is not a octal constant; neither is 009.123. fixing thisDenys Vlasenko2010-10-051-8/+40
| | | | | | | function old new delta my_strtod 80 113 +33 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* *: make GNU licensing statement forms more regularDenys Vlasenko2010-08-161-1/+1
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: add comment about fixing bug 1333Denys Vlasenko2010-04-041-0/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: don't append bogus data after NUL in sub(); shrinkDenys Vlasenko2010-04-041-50/+68
| | | | | | | | | | also renamed variables to more sensible names function old new delta mk_re_node 56 49 -7 awk_sub 601 591 -10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: code shrinkDenys Vlasenko2010-03-121-33/+39
| | | | | | | function old new delta evaluate 3550 3487 -63 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: code shrinkDenys Vlasenko2010-03-121-143/+154
| | | | | | | | function old new delta hash_find 233 234 +1 evaluate 3899 3550 -349 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: style fixesDenys Vlasenko2010-03-121-19/+20
| | | | | | | | function old new delta hash_find 234 233 -1 awk_printf 457 453 -4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: code shrinkDenys Vlasenko2010-03-121-8/+15
| | | | | | | function old new delta exec_builtin 1538 1489 -49 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: code shrinkDenys Vlasenko2010-03-111-7/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: code shrink; style fixesDenys Vlasenko2010-03-111-41/+71
| | | | | | | function old new delta next_token 932 862 -70 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: be more paranoid when freeing loop variable; make code less obfuscatedDenys Vlasenko2010-03-111-21/+49
| | | | | | | | | | | | function old new delta nvfree 149 170 +21 next_token 928 932 +4 getvar_i 95 94 -1 skip_spaces 51 45 -6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 25/-7) Total: 18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: simple code shrinkDenys Vlasenko2010-03-101-11/+13
| | | | | | | | | | | | | | function old new delta awk_getline 710 724 +14 awk_printf 455 457 +2 hash_find 234 233 -1 qrealloc 33 31 -2 handle_special 499 482 -17 awk_sub 641 601 -40 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/4 up/down: 16/-60) Total: -44 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: fix the case where nested "for" loops with the same variable misbehaveDenys Vlasenko2010-03-101-10/+20
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: skip whitespace between array name and subscriptAlexander Shishkin2010-02-261-1/+1
| | | | | | | | | | | | | It is supported in both mawk and gawk and there are actually scripts out there that use this "flexibility". function old new delta next_token 1144 1152 +8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 8/0) Total: 8 bytes Signed-off-by: Alexander Shishkin <virtuoso@slind.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: remove wrong commentDenys Vlasenko2010-02-051-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: suppress ~60% of "aliased warnings" on gcc-4.4.1Denys Vlasenko2010-02-041-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: fix an incorrect casting to string (bug 725). -44 bytes.Denys Vlasenko2009-11-301-6/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: preparatory patch, no essential code changes. -13 bytes.Denys Vlasenko2009-11-301-30/+43
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: introduce and use ffulsh_all()Denys Vlasenko2009-11-021-2/+2
| | | | | | | | | | | | | | | | | | | | function old new delta buffer_fill_and_print 179 196 +17 fflush_all - 9 +9 spawn 87 92 +5 rtcwake_main 455 453 -2 ... alarm_intr 93 84 -9 readcmd 1072 1062 -10 bb_ask 345 333 -12 more_main 845 832 -13 flush_stdout_stderr 42 23 -19 xfflush_stdout 27 - -27 flush_stderr 30 - -30 ------------------------------------------------------------------------------ (add/remove: 1/2 grow/shrink: 2/50 up/down: 31/-397) Total: -366 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* small optimizations of toupper/tolowerDenys Vlasenko2009-10-231-8/+5
| | | | | | | function old new delta in_ib 191 172 -19 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: use {i,u}toa() where appropriateDenys Vlasenko2009-10-061-3/+1
| | | | | | | | | | | function old new delta startservice 377 363 -14 setari_u 54 40 -14 ash_main 1375 1361 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-42) Total: -42 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: fix typo in prev commitDenys Vlasenko2009-09-211-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: implement mktimeLeonid Lisovskiy2009-09-211-4/+36
| | | | | | | | | | | | | | function old new delta exec_builtin - 1466 +1466 do_mktime - 116 +116 tokenlist 441 448 +7 tokeninfo 396 400 +4 evaluate 5395 3755 -1640 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 2/1 up/down: 1593/-1640) Total: -47 bytes Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>