diff options
Diffstat (limited to 'scripts/kconfig')
-rw-r--r-- | scripts/kconfig/kxgettext.c | 7 |
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++ = '"'; |