libextractor

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

commit fa109a96494188832f68bf31b7bbb465b624f006
parent 21ca135e01d859bdbc8197072f388edffbbba0cc
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat, 12 Jun 2010 14:43:54 +0000

fix

Diffstat:
Msrc/main/extract.c | 20+++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/main/extract.c b/src/main/extract.c @@ -471,8 +471,8 @@ static void finish_bibtex (const char *fn) { int i; - char *tya; const char *et; + char temp[20]; if (entry_type != NULL) et = entry_type; @@ -487,12 +487,22 @@ finish_bibtex (const char *fn) fn); else { + snprintf (temp, + sizeof (temp), + "%.5s%.5s%.5s", + btm[2].value, + btm[1].value, + btm[0].value); + + for (i=strlen(temp)-1;i>=0;i-- ) + if (! isalnum( (unsigned char) temp[i]) ) + temp[i] = '_'; + else + temp[i] = tolower( (unsigned char) temp[i]); fprintf (stdout, - "@%s %.5s%.5s%.5s { ", + "@%s %s { ", et, - btm[2].value, - btm[1].value, - btm[0].value); + temp); }