- Allow joining short options into one commandline argument.

- Resolves: #239695
This commit is contained in:
Petr Machata 2007-05-11 15:16:29 +00:00
parent 86ea3606d6
commit 7d310a2b22
2 changed files with 45 additions and 1 deletions

38
flex-2.5.33-opts.patch Normal file
View File

@ -0,0 +1,38 @@
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-pm/scanopt.c 2007-05-11 17:03:01.000000000 +0200
@@ -789,12 +789,12 @@ int scanopt (svoid, arg, optindex)
}
optarg = pstart + 1;
- arglen = 0;
- while (optarg[arglen])
- arglen++;
-
- if (arglen == 0)
+ if (!*optarg) {
optarg = NULL;
+ arglen = 0;
+ }
+ else
+ arglen = strlen (optarg);
}
/* At this point, we have a long or short option matched at opt_offset into
@@ -812,13 +812,10 @@ int scanopt (svoid, arg, optindex)
/* case: no args allowed */
if (auxp->flags & ARG_NONE) {
- if (optarg) {
- scanopt_err (s, opt_offset, is_short, errcode =
- SCANOPT_ERR_ARG_NOT_ALLOWED);
+ if (!optarg)
INC_INDEX (s, 1);
- return errcode;
- }
- INC_INDEX (s, 1);
+ else
+ s->subscript++;
return optp->r_val;
}

View File

@ -1,13 +1,14 @@
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: 5%{?dist} Release: 6%{?dist}
License: BSD License: BSD
Group: Development/Tools Group: Development/Tools
URL: http://flex.sourceforge.net/ URL: http://flex.sourceforge.net/
Source: flex-%{version}.tar.bz2 Source: flex-%{version}.tar.bz2
Patch0: flex-2.5.33-pic.patch Patch0: flex-2.5.33-pic.patch
Patch1: flex-2.5.33-yy.patch Patch1: flex-2.5.33-yy.patch
Patch2: flex-2.5.33-opts.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: m4 Requires: m4
BuildRequires: gettext info bison m4 BuildRequires: gettext info bison m4
@ -32,6 +33,7 @@ application development.
%setup -q %setup -q
%patch0 -p1 %patch0 -p1
%patch1 -p1 %patch1 -p1
%patch2 -p1
%build %build
%configure --disable-dependency-tracking %configure --disable-dependency-tracking
@ -78,6 +80,10 @@ 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
- Allow joining short options into one commandline argument.
- Resolves: #239695
* Fri Mar 30 2007 Petr Machata <pmachata@redhat.com> - 2.5.33-5 * Fri Mar 30 2007 Petr Machata <pmachata@redhat.com> - 2.5.33-5
- Make yy-prefixed variables available to scanner even with -P. - Make yy-prefixed variables available to scanner even with -P.