Commit 964267e627966ffa018fc4a3e19e6bad337a9125

Authored by Egry Gabor
Committed by Linus Torvalds
1 parent c196eff306

[PATCH] kconfig: kxgettext: EOL fix

The end of line character doesn't exist on end of help in all case, check it
first.

Signed-off-by: Egry Gabor <gaboregry@t-online.hu>
Cc: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 6 additions and 1 deletions Side-by-side Diff

scripts/kconfig/kxgettext.c
... ... @@ -14,7 +14,12 @@
14 14 {
15 15 char *bfp = bf;
16 16 int multiline = strchr(text, '\n') != NULL;
  17 + int eol = 0;
  18 + int textlen = strlen(text);
17 19  
  20 + if ((textlen > 0) && (text[textlen-1] == '\n'))
  21 + eol = 1;
  22 +
18 23 *bfp++ = '"';
19 24 --len;
20 25  
... ... @@ -43,7 +48,7 @@
43 48 --len;
44 49 }
45 50  
46   - if (multiline)
  51 + if (multiline && eol)
47 52 bfp -= 3;
48 53  
49 54 *bfp++ = '"';