Skip to content

Commit

Permalink
[PATCH] kconfig: kxgettext: EOL fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Egry Gabor authored and Linus Torvalds committed Sep 5, 2005
1 parent c196eff commit 964267e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/kconfig/kxgettext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -43,7 +48,7 @@ static char *escape(const char* text, char *bf, int len)
--len;
}

if (multiline)
if (multiline && eol)
bfp -= 3;

*bfp++ = '"';
Expand Down

0 comments on commit 964267e

Please sign in to comment.