Fix in patch.

This commit is contained in:
Petr Machata 2007-05-11 15:49:39 +00:00
parent 7d310a2b22
commit 9c030ea142
2 changed files with 11 additions and 9 deletions

View File

@ -1,6 +1,6 @@
diff -urp flex-2.5.33/scanopt.c flex-2.5.33-pm/scanopt.c diff -urp flex-2.5.33/scanopt.c flex-2.5.33-pm/scanopt.c
--- flex-2.5.33/scanopt.c 2002-08-29 22:30:25.000000000 +0200 --- flex-2.5.33/scanopt.c 2002-08-29 22:30:25.000000000 +0200
+++ flex-2.5.33-pm/scanopt.c 2007-05-11 17:03:01.000000000 +0200 +++ flex-2.5.33-pm/scanopt.c 2007-05-11 17:48:29.000000000 +0200
@@ -789,12 +789,12 @@ int scanopt (svoid, arg, optindex) @@ -789,12 +789,12 @@ int scanopt (svoid, arg, optindex)
} }
@ -19,18 +19,20 @@ diff -urp flex-2.5.33/scanopt.c flex-2.5.33-pm/scanopt.c
} }
/* At this point, we have a long or short option matched at opt_offset into /* At this point, we have a long or short option matched at opt_offset into
@@ -812,13 +812,10 @@ int scanopt (svoid, arg, optindex) @@ -812,13 +812,16 @@ int scanopt (svoid, arg, optindex)
/* case: no args allowed */ /* case: no args allowed */
if (auxp->flags & ARG_NONE) { if (auxp->flags & ARG_NONE) {
- if (optarg) { - if (optarg) {
- scanopt_err (s, opt_offset, is_short, errcode = + if (optarg && !is_short) {
- SCANOPT_ERR_ARG_NOT_ALLOWED); scanopt_err (s, opt_offset, is_short, errcode =
+ if (!optarg) SCANOPT_ERR_ARG_NOT_ALLOWED);
INC_INDEX (s, 1); INC_INDEX (s, 1);
- return errcode; return errcode;
- } }
- INC_INDEX (s, 1); - INC_INDEX (s, 1);
+ else if (!optarg)
+ INC_INDEX (s, 1);
+ else + else
+ s->subscript++; + s->subscript++;
return optp->r_val; return optp->r_val;

View File

@ -1,7 +1,7 @@
Summary: A tool for creating scanners (text pattern recognizers) Summary: A tool for creating scanners (text pattern recognizers)
Name: flex Name: flex
Version: 2.5.33 Version: 2.5.33
Release: 6%{?dist} Release: 7%{?dist}
License: BSD License: BSD
Group: Development/Tools Group: Development/Tools
URL: http://flex.sourceforge.net/ URL: http://flex.sourceforge.net/
@ -80,7 +80,7 @@ rm -rf ${RPM_BUILD_ROOT}
%{_infodir}/flex.info* %{_infodir}/flex.info*
%changelog %changelog
* Fri May 11 2007 Petr Machata <pmachata@redhat.com> - 2.5.33-6 * Fri May 11 2007 Petr Machata <pmachata@redhat.com> - 2.5.33-7
- Allow joining short options into one commandline argument. - Allow joining short options into one commandline argument.
- Resolves: #239695 - Resolves: #239695