commit 13d75a142b68a42f188232cff10402f5e15c1a7c
parent 8e1dad2066af454ccd8ef0c004960f5050a00bfa
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 15 Sep 2013 16:58:38 +0000
strip tailing whitespace in comments
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/plugins/jpeg_extractor.c b/src/plugins/jpeg_extractor.c
@@ -153,8 +153,14 @@ EXTRACTOR_jpeg_extract_method (struct EXTRACTOR_ExtractContext *ec)
goto EXIT;
for (mptr = jds.marker_list; NULL != mptr; mptr = mptr->next)
{
+ size_t off;
+
if (JPEG_COM != mptr->marker)
continue;
+ off = 0;
+ while ( (off < mptr->data_length) &&
+ (isspace ((int) ((const char *)mptr->data)[mptr->data_length - 1 - off])) )
+ off++;
if (0 !=
ec->proc (ec->cls,
"jpeg",
@@ -162,7 +168,7 @@ EXTRACTOR_jpeg_extract_method (struct EXTRACTOR_ExtractContext *ec)
EXTRACTOR_METAFORMAT_C_STRING,
"text/plain",
(const char *) mptr->data,
- mptr->data_length))
+ mptr->data_length - off))
goto EXIT;
}