]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Bug fixes.
authorBruno Haible <bruno@clisp.org>
Fri, 21 Sep 2001 14:46:26 +0000 (14:46 +0000)
committerBruno Haible <bruno@clisp.org>
Fri, 21 Sep 2001 14:46:26 +0000 (14:46 +0000)
src/ChangeLog
src/x-java.l

index 5b027fab3f28a643f48ec0396ff70d6ebf160962..550a08b5b1f1bb466bb9e9ed282885ddbca3e212 100644 (file)
@@ -1,3 +1,9 @@
+2001-09-21  Tommy Johansson  <tommy.johansson@kanalen.org>
+
+       * x-java.l (create_char_buf): Fix problem with empty messages.
+       (//): Remove leading "//" from result.
+       (x_java_keyword): Handle NULL argument.
+
 2001-09-19  Tommy Johansson  <tommy.johansson@kanalen.org>
 
        * x-java.l (is_keyword): Swap arguments of do_compare.
index 6c0603dbd8a6c81e07a68557d58857213a29d4ed..4238e4e11a51670511e51b70d6ef3e6ecb1674d5 100644 (file)
@@ -93,6 +93,7 @@ create_char_buf ()
 {
   char_buf *b = (char_buf *) xmalloc (sizeof (char_buf));
   b->data = (char *) xmalloc (INITIAL_CHARBUF_SIZE);
+  b->data[0] = '\0';
   b->len = 0;
   b->maxlen = INITIAL_CHARBUF_SIZE;
   return b;
@@ -200,7 +201,7 @@ ID [a-zA-Z_][a-zA-Z0-9_]*
 "#"|"@"|"\r"|"`" /* ignore whitespace */
 
 "//"[^\n]* {
-  parser_global->comment = xstrdup (yytext);
+  parser_global->comment = xstrdup (yytext + 2);
   return JAVA_COMMENT;
 }
 "\n"|"\r"|"\r\n" parser_global->line_no++;
@@ -311,6 +312,14 @@ void
 x_java_keyword (keyword)
      const char *keyword;
 {
+  if (keyword == NULL) {
+    if (java_keywords != NULL) {
+      string_list_destroy (java_keywords);
+      java_keywords = NULL;
+    }
+    return;
+  }
+
   if (java_keywords == NULL)
     java_keywords = string_list_alloc ();