From 7f9885c84228afdde6159915b0e742fc0be1f9dd Mon Sep 17 00:00:00 2001 From: h_vogt Date: Thu, 17 Jun 2010 21:55:40 +0000 Subject: [PATCH] remove extra white spaces in inp_fix_gnd_name() --- ChangeLog | 4 ++++ src/frontend/inpcom.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 75f885282..fcef2221f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-06-17 Holger Vogt + * inpcom.c: in inp_fix_gnd_name() remove excessive white spaces + around 0 after replacing "gnd" by " 0 " + 2010-06-16 Holger Vogt * src/Makefile.am: for WINDOWS all of help files and related files excluded diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index d96e74c2f..b4cb31b45 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -236,7 +236,8 @@ inp_fix_gnd_name( struct line *deck ) { while ( c != NULL ) { gnd = c->li_line; - if ( *gnd == '*' ) { c = c->li_next; continue; } + // if there is a comment or no gnd, go to next line + if (( *gnd == '*' ) || (strstr( gnd, "gnd" ) == NULL)) { c = c->li_next; continue; } // replace "§gnd§" by "§ 0 §", § being a ' ' ',' '(' ')'. while ( (gnd = strstr( gnd, "gnd" ) ) ) { if (( isspace(*(gnd-1)) || *(gnd-1) == '(' || *(gnd-1) == ',' ) && @@ -246,6 +247,8 @@ inp_fix_gnd_name( struct line *deck ) { } gnd += 3; } + // now remove the extra white spaces around 0 + c->li_line = inp_remove_ws(c->li_line); c = c->li_next; } }