summaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/kxgettext.c
diff options
context:
space:
mode:
authorEgry Gabor <gaboregry@t-online.hu>2005-09-03 15:55:14 -0700
committerLinus Torvalds <torvalds@evo.osdl.org>2005-09-05 00:05:49 -0700
commit964267e627966ffa018fc4a3e19e6bad337a9125 (patch)
treeb13b700da9e5b674c6a819f8826b70d476a59139 /scripts/kconfig/kxgettext.c
parentc196eff3060270f155343b63ef3d06f31ccfcd2e (diff)
downloadop-kernel-dev-964267e627966ffa018fc4a3e19e6bad337a9125.zip
op-kernel-dev-964267e627966ffa018fc4a3e19e6bad337a9125.tar.gz
[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>
Diffstat (limited to 'scripts/kconfig/kxgettext.c')
-rw-r--r--scripts/kconfig/kxgettext.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c
index ad1cb94..abee55c 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++ = '"';
OpenPOWER on IntegriCloud