From: Egry Gabor Date: Sat, 3 Sep 2005 22:55:14 +0000 (-0700) Subject: [PATCH] kconfig: kxgettext: EOL fix X-Git-Tag: v2.6.14-rc1~947 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=964267e627966ffa018fc4a3e19e6bad337a9125;p=linux-2.6-omap-h63xx.git [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 Cc: Arnaldo Carvalho de Melo Cc: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c index ad1cb9451a2..abee55ca617 100644 --- a/scripts/kconfig/kxgettext.c +++ b/scripts/kconfig/kxgettext.c @@ -14,6 +14,11 @@ static char *escape(const char* text, char *bf, int len) { char *bfp = bf; int multiline = strchr(text, '\n') != NULL; + int eol = 0; + int textlen = strlen(text); + + if ((textlen > 0) && (text[textlen-1] == '\n')) + eol = 1; *bfp++ = '"'; --len; @@ -43,7 +48,7 @@ next: --len; } - if (multiline) + if (multiline && eol) bfp -= 3; *bfp++ = '"';