]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix two while loops.
authorBruno Haible <bruno@clisp.org>
Wed, 9 Jan 2002 12:34:04 +0000 (12:34 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 22:39:25 +0000 (00:39 +0200)
src/ChangeLog
src/x-java.l

index ee8cfe47e4ba59debd5f14626741b7f40dceeeb2..61289d5cf0f71d488cc6e5d6afc0c92d8edfdf63 100644 (file)
@@ -1,3 +1,11 @@
+2002-01-09  Bruno Haible  <bruno@clisp.org>
+
+       * x-java.l (strip_ending_spaces): Fix logic.
+
+2002-01-09  Tommy Johansson  <tommy.johansson@kanalen.org>
+
+       * x-java.l: Avoid endless loop when encountering unterminated string.
+
 2002-01-08  Bruno Haible  <bruno@clisp.org>
 
        * message.h (format_type): New enum value 'format_elisp'.
index 02053e93c19f22f90d2d8ffa4c72ee49b45530b3..6e6bd998e2d57034595fc0f49b82e49cd8dc4a19 100644 (file)
@@ -164,8 +164,8 @@ strip_ending_spaces (str)
 {
   int len = strlen (str);
 
-  while (isspace ((unsigned char) str[len--]))
-    ;
+  while (len > 0 && isspace ((unsigned char) str[len - 1]))
+    len--;
   str[len] = '\0';
 }
 %}
@@ -205,7 +205,7 @@ ID [a-zA-Z_][a-zA-Z0-9_]*
   int c;
   char *str;
   char_buf *charbuf = create_char_buf ();
-  while ((c = input ()) != '"')
+  while ((c = input ()) != EOF && c != '"')
     {
       update_line_no (c);
       append_char_buf (charbuf, c);