]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
xgettext: Fix bug in shell script parser (regression from 2019-09-15).
authorBruno Haible <bruno@clisp.org>
Sun, 6 Oct 2019 02:20:01 +0000 (04:20 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 6 Oct 2019 02:20:01 +0000 (04:20 +0200)
* gettext-tools/src/x-sh.c (read_command): Set matters_for_argparser = false
when context_iter is not being initialized.

gettext-tools/src/x-sh.c

index ce8a864d4840079da3ce9f8058b2978666d06883..341f7027f0b3435785c5fddc2acfbbe1402ebb2c 100644 (file)
@@ -1327,8 +1327,10 @@ read_command (int looking_for, flag_context_ty outer_context)
               arg = 0;
               if (inner.type == t_assignment)
                 {
-                  /* An assignment just set an environment variable.
+                  /* An assignment just sets an environment variable.
                      Ignore it.  */
+                  /* Don't increment arg in this round.  */
+                  matters_for_argparser = false;
                 }
               else if (inner.type == t_string)
                 {
@@ -1338,6 +1340,8 @@ read_command (int looking_for, flag_context_ty outer_context)
                     {
                       /* The 'env' command just introduces more assignments.
                          Ignore it.  */
+                      /* Don't increment arg in this round.  */
+                      matters_for_argparser = false;
                     }
                   else
                     {