libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit f2dc615133963bdac5a0a836cb1e88ed72cb3c67
parent c87dab5b377b634321e403bdf32d3d415079903f
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue, 23 Aug 2005 19:29:55 +0000

bugfix - ole2 character set conversion

Diffstat:
MChangeLog | 4++++
MTODO | 2+-
Msrc/plugins/ole2/ole2extractor.c | 8++++----
3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,7 @@ +Tue Aug 23 12:35:35 PDT 2005 + Fixed character set conversion in OLE2 extractor + (big thanks to Jody Goldberg). + Sat Aug 20 21:27:17 PDT 2005 Fixed memory leak in thumbnail extractor. diff --git a/TODO b/TODO @@ -43,5 +43,5 @@ UTF-8 conversion (only listing what is left to do): * DEB: to be done * ASF: ? * HTML: to be done -* OLE2: done, but buggy +* OLE2: done * OO: to be done diff --git a/src/plugins/ole2/ole2extractor.c b/src/plugins/ole2/ole2extractor.c @@ -798,7 +798,7 @@ static struct EXTRACTOR_Keywords * process(struct GsfInput * in, int ipc; if (G_VALUE_TYPE(v) == G_TYPE_STRING) { - contents = g_strdup_value_contents(v); + contents = strdup(g_value_get_string(v)); } else { /* convert other formats? */ contents = g_strdup_value_contents(v); @@ -809,9 +809,9 @@ static struct EXTRACTOR_Keywords * process(struct GsfInput * in, if ( (isprint(contents[ipc])) && (! isspace(contents[ipc])) ) pc++; - if (NULL != strstr(contents, - "\\n")) - strstr(contents, "\\n")[0] = '\0'; /* kill '\n' */ + if ( (strlen(contents) > 0) && + (contents[strlen(contents)-1] == '\n') ) + contents[strlen(contents)-1] = '\0'; } if (pc > 0) { int pos = 0;