-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tre-agrep can drop records that have a match #43
Comments
probably has NULs in it? christos
|
No. There are no NULs. But, there are bytes with the top bit turned on. The files I have been seeing problems with contain some Unicode code points. This, I believe is the key to why This 8-bit data also accounts for other problems with dropped records. When there are any characters in When I use the plain (Wu and Manber) agrep, I cannot say that this is a bug in tre-agrep, just a caveat, because the man page says nothing one way or another about Unicode or 8-bit characters. But, I think it would be nice to make tre-agrep be able to find delimiters, even if it does not otherwise support Unicode or any 8-bit data. -- Guy Shaw |
tre-agrep has mysteriously failed to print some records that I know contain a match. I traced the program logic to a point where I knew that tre-grep knew there was a match, but no record printed. I changed this line:
printf("%.*s", record_len, record);
to
fwrite(record, record_len, 1, stdout);
and now it works. Go figure.
I have been programming in C for a long time, but I must confess that I do not think I have any experience with
"%.*s"
printf conversion. But it seems like it should work.This is on Kubuntu Linux 15.04.
The original bug was encountered on the tre-agrep program that was installed using the packages supplied by Kubuntu. The "workaround" was applied to the source code as it came from the Debian package, and compiled with GCC and using glibc.
The text was updated successfully, but these errors were encountered: