]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - scripts/kconfig/kxgettext.c
compat_blkdev_driver_ioctl: Remove unused variable warning
[linux-2.6-omap-h63xx.git] / scripts / kconfig / kxgettext.c
index 1c88d7c6d5a718ca9850bab1bf410f2439c51fab..6eb72a7f2562fc2d79847d8e4da2ad3ebb539a25 100644 (file)
@@ -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++ = '"';
@@ -165,8 +170,8 @@ void menu_build_message_list(struct menu *menu)
                     menu->file == NULL ? "Root Menu" : menu->file->name,
                     menu->lineno);
 
-       if (menu->sym != NULL && menu->sym->help != NULL)
-               message__add(menu->sym->help, menu->sym->name,
+       if (menu->sym != NULL && menu_has_help(menu))
+               message__add(menu_get_help(menu), menu->sym->name,
                             menu->file == NULL ? "Root Menu" : menu->file->name,
                             menu->lineno);
 
@@ -179,7 +184,11 @@ static void message__print_file_lineno(struct message *self)
 {
        struct file_line *fl = self->files;
 
-       printf("\n#: %s:%d", fl->file, fl->lineno);
+       putchar('\n');
+       if (self->option != NULL)
+               printf("# %s:00000\n", self->option);
+
+       printf("#: %s:%d", fl->file, fl->lineno);
        fl = fl->next;
 
        while (fl != NULL) {
@@ -187,9 +196,6 @@ static void message__print_file_lineno(struct message *self)
                fl = fl->next;
        }
 
-       if (self->option != NULL)
-               printf(", %s:00000", self->option);
-
        putchar('\n');
 }
 
@@ -206,7 +212,9 @@ void menu__xgettext(void)
        struct message *m = message__list;
 
        while (m != NULL) {
-               message__print_gettext_msgid_msgstr(m);
+               /* skip empty lines ("") */
+               if (strlen(m->msg) > sizeof("\"\""))
+                       message__print_gettext_msgid_msgstr(m);
                m = m->next;
        }
 }