提交 964267e6 编写于 作者: E Egry Gabor 提交者: Linus Torvalds

[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: NEgry Gabor <gaboregry@t-online.hu>
Cc: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 c196eff3
......@@ -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 @@ static char *escape(const char* text, char *bf, int len)
--len;
}
if (multiline)
if (multiline && eol)
bfp -= 3;
*bfp++ = '"';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册