aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig')
-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 ad1cb9451a24..abee55ca6174 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)
14{ 14{
15 char *bfp = bf; 15 char *bfp = bf;
16 int multiline = strchr(text, '\n') != NULL; 16 int multiline = strchr(text, '\n') != NULL;
17 int eol = 0;
18 int textlen = strlen(text);
19
20 if ((textlen > 0) && (text[textlen-1] == '\n'))
21 eol = 1;
17 22
18 *bfp++ = '"'; 23 *bfp++ = '"';
19 --len; 24 --len;
@@ -43,7 +48,7 @@ next:
43 --len; 48 --len;
44 } 49 }
45 50
46 if (multiline) 51 if (multiline && eol)
47 bfp -= 3; 52 bfp -= 3;
48 53
49 *bfp++ = '"'; 54 *bfp++ = '"';