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.
This commit is contained in:
@@ -8,16 +8,13 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "libbb.h"
|
||||
#include "xregex.h"
|
||||
|
||||
|
||||
|
||||
void xregcomp(regex_t *preg, const char *regex, int cflags)
|
||||
{
|
||||
int ret;
|
||||
if ((ret = regcomp(preg, regex, cflags)) != 0) {
|
||||
int ret = regcomp(preg, regex, cflags);
|
||||
if (ret) {
|
||||
int errmsgsz = regerror(ret, preg, NULL, 0);
|
||||
char *errmsg = xmalloc(errmsgsz);
|
||||
regerror(ret, preg, errmsg, errmsgsz);
|
||||
|
Reference in New Issue
Block a user