]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix a small Perl parsing bug.
authorBruno Haible <bruno@clisp.org>
Fri, 1 Oct 2004 12:13:35 +0000 (12:13 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:11:56 +0000 (12:11 +0200)
gettext-tools/src/ChangeLog
gettext-tools/src/x-perl.c
gettext-tools/tests/ChangeLog
gettext-tools/tests/xgettext-perl-4

index 5d070aa402e831b9b167174d70169f74b7f03457..779062d67dc0d1229f7e7b0ccc6ff856f29a97ea 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-01  Guido Flohr  <guido@imperia.net>
+
+       * x-perl.c (x_perl_prelex): Recognize function names starting with '-'.
+       Reported by Ryan Anderson <ryan@autoweb.net>.
+
 2004-09-16  Bruno Haible  <bruno@clisp.org>
 
        * format.h (formatstring_error_logger_t): Modify decl for GCC <= 3.0.
index 9fe5b8192f07d2eb6cabbe33927d1f6b8a181085..b17315a5bca2b2aea4d4a7bc5314d0dbb10c8a61 100644 (file)
@@ -1,5 +1,5 @@
 /* xgettext Perl backend.
-   Copyright (C) 2002-2003 Free Software Foundation, Inc.
+   Copyright (C) 2002-2004 Free Software Foundation, Inc.
 
    This file was written by Guido Flohr <guido@imperia.net>, 2002-2003.
 
@@ -2459,6 +2459,13 @@ x_perl_prelex (message_list_ty *mlp, token_ty *tp)
              tp->type = token_type_dereference;
              return;
            }
+         else if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
+           {
+             /* One of the -X (filetest) functions.  We play safe
+                and accept all alphabetical characters here.  */
+             tp->type = token_type_other;
+             return;
+           }
          phase1_ungetc (c);
          tp->type = token_type_other;
          prefer_division_over_regexp = false;
index db69d239eef3be943c1ca02e7ee4f4b9152c3203..a0bdde354e0b37f49e91bde0b94f461fa8fab881 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-01  Guido Flohr  <guido@imperia.net>
+
+       * xgettext-perl-4: Add test case with '-s' function.
+       Reported by Ryan Anderson <ryan@autoweb.net>.
+
 2004-09-11  Bruno Haible  <bruno@clisp.org>
 
        * msginit-1: New file.
index 8a00ece76db4dabc2a538f8d5a1d34ddc90eccda..2dae75cdacbc206629314ced239da03512ce49ab 100755 (executable)
@@ -44,6 +44,11 @@ print "@{[hello_func]} world!\n";
 print `ls $0`;
 print qx;ls $0;;
 
+if (!defined($size = -s $filename)) {
+  # The above s is part of the function -s, not 
+  # the substitution operator!    
+}
+
 # The rest requires a Unicode aware Perl.
 require 5.006;
 print "\U\x70\LO\154\x{69}\x{004E}a \Q\lRu\LLeS\E\041\n";