Commit Graph

45 Commits

Author SHA1 Message Date
Denis Vlasenko
06af216528 suppress warnings about easch <applet>_main() having
no preceding prototype
2007-02-03 17:28:39 +00:00
Denis Vlasenko
50ddabc859 less: fix <tab><backspace> buglet 2006-12-31 19:36:01 +00:00
Denis Vlasenko
95b307103a less: interpret backspace.
less is officially declared PAGER-capable! ;)
(this includes viewing of manpages)
2006-12-31 19:23:31 +00:00
Denis Vlasenko
806116b234 fixes from Yann E. MORIN <yann.morin.1998@anciens.enib.fr> 2006-12-31 12:14:16 +00:00
Denis Vlasenko
3bba545a54 done a dozen of randconfig test. guess what? ALL failed...
these are resulting fixes
2006-12-30 17:57:03 +00:00
Denis Vlasenko
5a4f0994b0 less: fix regexp search '/' on large files 2006-12-25 01:23:02 +00:00
Denis Vlasenko
7cea262273 small stupid changes. no code changes 2006-12-24 07:30:09 +00:00
Denis Vlasenko
f4dff77355 less: implement waiting for input using select(). Rather tricky business.
But we do not read entire input anymore up-front.
2006-12-24 07:14:17 +00:00
Denis Vlasenko
f1282a8792 less: a few fixes for cases where we overflow status line 2006-12-21 17:03:20 +00:00
Denis Vlasenko
f65d1338dc less: restore TAB display (was showing as inverse I after prev changes :) 2006-12-21 15:23:45 +00:00
Denis Vlasenko
d51d14e36f less: "(null)" is a bit strange. "standard input" is better :) 2006-12-21 13:57:37 +00:00
Denis Vlasenko
e147a72173 less: how many different kinds of status line we need, three?!
small fixes. [prev commit also added control char filtering
on input (e.g. regexp input, filename input for 'E' etc)]
2006-12-21 13:26:54 +00:00
Denis Vlasenko
e865e81d34 less: stop dying on bad regexps, quietly pipe data w/o
user interaction if stdout is not a tty.
size optimizations
2006-12-21 13:24:58 +00:00
Denis Vlasenko
3f3190e34c less: total cleanup and bugfix.
Doesn't die horribly on binary files anymore.
In fact, they _100%_ work now. Control chars
are in reverse video, including DEL and that idiocy of VT-10x,
Meta-ESC [inventor of which should be prohibited from reproducing].
Regex search is fixed also. When you specify search ('/' key),
control chars turn into dots (unhighlighted),
and found occurrences highlighted instead. This is reversible.
Memory management fixed (was leaky as hell) and optimized.
Linewrapping fixed and thoroughly tested.
Max buffer size made configurable.
~ 600 bytes saved.
2006-12-21 00:22:03 +00:00
Denis Vlasenko
9a7cef930f less: somewhat buggy applet, but nice. Muchly reduced
xstrdup'ing and memory consumption. Made linewrap saner.
regex matching code was awful - still buggy, but not as
leaky as before. Made buffer size configurable. Killed
several static and on-stack buffers. Hopefully eliminated
staircase effect on Ctrl-C (unable to reproduce).
2006-12-20 02:46:48 +00:00
Bernhard Reutner-Fischer
882e60c442 - shrink less.
01a: svn version
01b: merge past_eof and inp_stdin into flags.
01c: merge match_backwards into flags.
01d: add handling of <HOME> and <END> keys, remove set_tty_raw, use fflush_stdout_and_exit
01e: rewrite special-key handling to be smaller.
01f: changing the format saves 4 bytes (alot of places would benefit from this)
   text    data     bss     dec     hex filename
   9034       8     648    9690    25da less.o.01a
   9023       8     640    9671    25c7 less.o.01b
   9027       8     636    9671    25c7 less.o.01c
   9068       8     636    9712    25f0 less.o.01d
   8990       8     636    9634    25a2 less.o.01e
   8986       8     636    9630    259e less.o.01f
2006-12-04 16:04:50 +00:00
Denis Vlasenko
f0ed376eda remove bb_printf and the like 2006-10-26 23:21:47 +00:00
Denis Vlasenko
e1a0d486e4 message string changes, mostly for consistency, also -32 bytes in .rodata 2006-10-20 13:28:22 +00:00
Denis Vlasenko
67b23e6043 getopt_ulflags -> getopt32.
It is impossible to formulate sane ABI based on
size of ulong because it can be 32-bit or 64-bit.
Basically it means that you cannot portably use
more that 32 option chars in one call anyway...
Make it explicit.
2006-10-03 21:00:06 +00:00
Denis Vlasenko
9213a9e0f2 whitespace cleanup 2006-09-17 16:28:10 +00:00
Bernhard Reutner-Fischer
d591a360d3 - merge -r15463:15564 from busybox_scratch branch through these changesets:
------------------------------------------------------------------------
r15465 | aldot | 2006-06-21 20:48:06 +0200 (Wed, 21 Jun 2006) | 3 lines

- use CONFIG_BUSYBOX_EXEC_PATH as before it one was broken by a recent revert.
- use xchdir() since all is invain if it fails there anyways, supposedly

------------------------------------------------------------------------
r15466 | aldot | 2006-06-21 20:55:16 +0200 (Wed, 21 Jun 2006) | 2 lines

- adjust docs to take CONFIG_BUSYBOX_EXEC_PATH into account.

------------------------------------------------------------------------
r15467 | aldot | 2006-06-21 21:31:24 +0200 (Wed, 21 Jun 2006) | 18 lines

- partial fallout of my TREE_USED touchup against gcc-4.2: rip unused vars, save
s 144 bytes
   text    data     bss     dec     hex filename
 862434   10156  645924 1518514  172bb2 busybox.old
 862322   10156  645892 1518370  172b22 busybox
function                                             old     new   delta
z_len                                                  4       -      -4
textend                                                4       -      -4
part_nb                                                4       -      -4
insize                                                 4       -      -4
ifile_size                                             4       -      -4
do_link                                                4       -      -4
new_text                                              70      60     -10
ipaddr_list_link                                      33      23     -10
gzip_main                                            898     822     -76
------------------------------------------------------------------------------
(add/remove: 0/6 grow/shrink: 0/3 up/down: 0/-120)           Total: -120 bytes


------------------------------------------------------------------------
r15468 | aldot | 2006-06-21 21:43:05 +0200 (Wed, 21 Jun 2006) | 19 lines

- remove useless global exports
function                                             old     new   delta
rpm_main                                             940    1601    +661
rpm_getstring                                        107     112      +5
rpm_getint                                           148     153      +5
loop_through_files                                   103     106      +3
fileaction_dobackup                                  115     113      -2
fileaction_list                                        5       -      -5
rpm_getcount                                          42       -     -42
extract_cpio_gz                                      161       -    -161
rpm_gettags                                          504       -    -504
------------------------------------------------------------------------------
(add/remove: 0/4 grow/shrink: 4/1 up/down: 674/-714)          Total: -40 bytes

   text    data     bss     dec     hex filename
 862322   10156  645892 1518370  172b22 busybox.old
 862290   10156  645892 1518338  172b02 busybox


------------------------------------------------------------------------
r15555 | aldot | 2006-06-30 14:10:11 +0200 (Fri, 30 Jun 2006) | 22 lines

- shrink syslog a little bit, move a big buffer (for 'line') off the bss, fold s
emaphore stuff into single caller manually.
  stats:
function                                             old     new   delta
logMessage                                           395     427     +32
message                                             1245    1257     +12
opts                                                   -       4      +4
small                                                  1       -      -1
local_logging                                          4       -      -4
doRemoteLog                                            4       -      -4
circular_logging                                       4       -      -4
syslogd_main                                        1299    1285     -14
static.res                                            36      16     -20
.rodata                                           186650  186586     -64
static.line                                         1025       -   -1025
------------------------------------------------------------------------------
(add/remove: 1/5 grow/shrink: 2/3 up/down: 48/-1136)        Total: -1088 bytes
cow@s37:~/src/busybox_scratch$ size sysklogd/syslogd.o{.orig,}
   text    data     bss     dec     hex filename
   3723     348    5242    9313    2461 sysklogd/syslogd.o.orig
   3697     348    4188    8233    2029 sysklogd/syslogd.o

==============================================================================
Overall bloatcheck for the changeset mentioned above:
function                                             old     new   delta
rpm_main                                             953    1608    +655
logMessage                                           395     427     +32
message                                             1245    1257     +12
opts                                                   -       4      +4
rpm_getstring                                        107     110      +3
rpm_getint                                           148     151      +3
loop_through_files                                   103     104      +1
small                                                  1       -      -1
fileaction_dobackup                                  115     113      -2
z_len                                                  4       -      -4
textend                                                4       -      -4
part_nb                                                4       -      -4
local_logging                                          4       -      -4
insize                                                 4       -      -4
ifile_size                                             4       -      -4
do_link                                                4       -      -4
doRemoteLog                                            4       -      -4
circular_logging                                       4       -      -4
fileaction_list                                        5       -      -5
new_text                                              70      60     -10
ipaddr_list_link                                      33      23     -10
clear_bufs                                            31      21     -10
syslogd_main                                        1287    1273     -14
builtin_help                                         190     176     -14
static.res                                            36      16     -20
builtin_source                                       229     199     -30
rpm_getcount                                          42       -     -42
gzip_main                                            842     786     -56
.rodata                                           227176  227112     -64
lash_main                                            609     527     -82
busy_loop                                           3883    3739    -144
extract_cpio_gz                                      155       -    -155
rpm_gettags                                          501       -    -501
static.line                                         1025       -   -1025
------------------------------------------------------------------------------
(add/remove: 1/15 grow/shrink: 6/12 up/down: 710/-2221)     Total: -1511 bytes
2006-08-20 17:35:13 +00:00
Rob Landley
d921b2ecc0 Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes...  General cleanup pass.  What I've
been doing for the last couple days.

And it conflicts!  I've removed httpd.c from this checkin due to somebody else
touching that file.  It builds for me.  I have to catch a bus.  (Now you know
why I'm looking forward to Mercurial.)
2006-08-03 15:41:12 +00:00
Bernhard Reutner-Fischer
c89982dcd7 - move #include busybox.h to the very top so we pull in the config
and eventual platform specific includes in early.
2006-06-03 19:49:21 +00:00
Rob Landley
69d863b6c6 And fix the error I just introduced. :) 2006-05-25 21:13:30 +00:00
Rob Landley
5a2997de72 Remove pointless #define. 2006-05-25 21:12:40 +00:00
Bernhard Reutner-Fischer
a85a63f6ee - fix invalid mode 2006-05-19 12:22:11 +00:00
Mike Frysinger
f054be12de Rob Sullivan writes: rewrite the regex handling to improve stability 2006-04-29 04:21:10 +00:00
Rob Landley
a2e98043d5 From Rob Sullivan: Fix a segfault with searching, plus some cleanups. 2006-04-18 01:53:41 +00:00
Mike Frysinger
20c22e0883 just use the stack to kill memleak and return if user didnt give us anything to match 2006-04-16 21:41:00 +00:00
Mike Frysinger
bf2d9905ca use xmalloc, dont hardcode length of string, and get rid of pointless call to memset 2006-04-16 21:30:47 +00:00
Mike Frysinger
00d10a94f3 uncuddle if statements 2006-04-16 20:54:19 +00:00
Mike Frysinger
f284c767e5 use more boiler plate GPL notices 2006-04-16 20:38:26 +00:00
Mike Frysinger
3a2b103eea uncuddle brackets 2006-04-16 20:34:26 +00:00
"Vladimir N. Oleynik"
73ffd762ca removed anoinig warnings 2006-02-01 12:56:19 +00:00
Rob Landley
ef1f7b5058 Ahem. Vladimir checked in a different fix bug didn't close out the bug.
Reverting...
2005-12-16 08:03:34 +00:00
Rob Landley
4b91b88fcb Less would segfault if it had no tty. (Bug 600.) 2005-12-16 08:02:11 +00:00
"Vladimir N. Oleynik"
8315cd527f fopen(TTY...) to bb_xfopen(), close bug 600 2005-12-15 11:53:22 +00:00
"Vladimir N. Oleynik"
39a841cecf change interface to bb_xasprintf() - more perfect for me.
ln.c: error_msg(str)->error_msg(%s, str) - remove standart "feature" for hackers
reduce 100 bytes don't care in sum
2005-09-29 16:18:57 +00:00
"Vladimir N. Oleynik"
b8fa7e88f2 quick patch - have removed stranges for me 2005-09-22 14:19:34 +00:00
"Vladimir N. Oleynik"
bc37480e9c 1) read from stdin work now
2) destroy segfault in number_process
3) removes dead code

complex patch my and Tito
2005-09-19 14:23:46 +00:00
"Vladimir N. Oleynik"
a0ae6de848 quick patchs: drop founded memory leak, more libbb, more C-compatibility, size reduction 2005-09-19 10:28:43 +00:00
Rob Landley
d57ae8b796 First cleanup pass, from Rob Sullivan. More to be done... 2005-09-18 00:58:49 +00:00
"Vladimir N. Oleynik"
8d3c40d492 more C-compatibily, Thanks Bernhard Fischer 2005-09-16 13:16:01 +00:00
"Vladimir N. Oleynik"
2b306e906f small change for highlihting flags, more busyboxes: indent, forward declaration, paste BSS 2005-09-16 12:32:22 +00:00
Rob Landley
9200e79d21 New applet "less", from Rob Sullivan. 2005-09-15 19:26:59 +00:00