remove extra white spaces in inp_fix_gnd_name()

This commit is contained in:
h_vogt 2010-06-17 21:55:40 +00:00
parent 1dcb43bf14
commit 7f9885c842
2 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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;
}
}