diff options
Diffstat (limited to 'scripts/kconfig/kxgettext.c')
-rw-r--r-- | scripts/kconfig/kxgettext.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c index 1c88d7c6d5a7..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++ = '"'; |
@@ -179,7 +184,11 @@ static void message__print_file_lineno(struct message *self) | |||
179 | { | 184 | { |
180 | struct file_line *fl = self->files; | 185 | struct file_line *fl = self->files; |
181 | 186 | ||
182 | printf("\n#: %s:%d", fl->file, fl->lineno); | 187 | putchar('\n'); |
188 | if (self->option != NULL) | ||
189 | printf("# %s:00000\n", self->option); | ||
190 | |||
191 | printf("#: %s:%d", fl->file, fl->lineno); | ||
183 | fl = fl->next; | 192 | fl = fl->next; |
184 | 193 | ||
185 | while (fl != NULL) { | 194 | while (fl != NULL) { |
@@ -187,9 +196,6 @@ static void message__print_file_lineno(struct message *self) | |||
187 | fl = fl->next; | 196 | fl = fl->next; |
188 | } | 197 | } |
189 | 198 | ||
190 | if (self->option != NULL) | ||
191 | printf(", %s:00000", self->option); | ||
192 | |||
193 | putchar('\n'); | 199 | putchar('\n'); |
194 | } | 200 | } |
195 | 201 | ||