diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-12-21 00:22:03 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-12-21 00:22:03 +0000 |
commit | cf9fa100e699b33a446b912558777d163c78fe88 (patch) | |
tree | 15ecde8cea8fcd622729c9210abfbd5ae2fef5ce /libbb | |
parent | cfafcc27fa26318943604b900f5a78ceda0bd314 (diff) | |
download | busybox-w32-cf9fa100e699b33a446b912558777d163c78fe88.tar.gz busybox-w32-cf9fa100e699b33a446b912558777d163c78fe88.tar.bz2 busybox-w32-cf9fa100e699b33a446b912558777d163c78fe88.zip |
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.
git-svn-id: svn://busybox.net/trunk/busybox@17023 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/xregcomp.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libbb/xregcomp.c b/libbb/xregcomp.c index 4bcb9aedf..6e9a29f49 100644 --- a/libbb/xregcomp.c +++ b/libbb/xregcomp.c | |||
@@ -8,16 +8,13 @@ | |||
8 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 8 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <stdio.h> | ||
12 | #include "libbb.h" | 11 | #include "libbb.h" |
13 | #include "xregex.h" | 12 | #include "xregex.h" |
14 | 13 | ||
15 | |||
16 | |||
17 | void xregcomp(regex_t *preg, const char *regex, int cflags) | 14 | void xregcomp(regex_t *preg, const char *regex, int cflags) |
18 | { | 15 | { |
19 | int ret; | 16 | int ret = regcomp(preg, regex, cflags); |
20 | if ((ret = regcomp(preg, regex, cflags)) != 0) { | 17 | if (ret) { |
21 | int errmsgsz = regerror(ret, preg, NULL, 0); | 18 | int errmsgsz = regerror(ret, preg, NULL, 0); |
22 | char *errmsg = xmalloc(errmsgsz); | 19 | char *errmsg = xmalloc(errmsgsz); |
23 | regerror(ret, preg, errmsg, errmsgsz); | 20 | regerror(ret, preg, errmsg, errmsgsz); |