commit 641ea1c86e0c10edda61e8c2263ad1816fbdc349
parent 990f29c8825aeb4578b2688cad389bcec96fda2e
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 31 Jan 2006 20:24:31 +0000
From:
Ronan MELENNEC <ronan.melennec@cena.fr>
To:
christian@grothoff.org
Date:
Today 09:42:09 am
Hello Christian,
I attach a patch to prevent manextractor.c to output false positives
(e.g. when there is a man page at beginning of a TAR archive).
Cordially,
Ronan Melennec
Diffstat:
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,6 @@
+Tue Jan 31 12:51:55 PST 2006
+ Mis-detection of man pages as part of TAR archives fixed.
+
Wed Jan 11 11:33:46 PST 2006
More Mime-types for the OLE2 extractor. Also ignore (harmless)
libc errors in plugins when extracting.
diff --git a/src/plugins/manextractor.c b/src/plugins/manextractor.c
@@ -20,7 +20,7 @@
#include "platform.h"
#include "extractor.h"
-#include <zlib.h>
+#include <ctype.h>
static char * stndup(const char * str,
size_t n) {
@@ -105,8 +105,11 @@ libextractor_man_extract(const char * filename,
&buf[pos],
xlen)) ||
( (pos != 0) &&
- (buf[pos-1] != '\n') ) ) )
+ (buf[pos-1] != '\n') ) ) ) {
+ if ( !isgraph(buf[pos]) && !isspace(buf[pos]) )
+ return prev;
pos++;
+ }
xsize = pos;
while ( (xsize < size) &&
(buf[xsize] != '\n') )