ports/80666: astyle port: a patch to fix command line option parser
Alex Rousskov
rousskov at measurement-factory.com
Thu May 5 16:20:08 UTC 2005
>Number: 80666
>Category: ports
>Synopsis: astyle port: a patch to fix command line option parser
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Thu May 05 16:20:02 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Alex Rousskov
>Release: FreeBSD 4.9-PRERELEASE i386
>Organization:
The Measurement Factory
>Environment:
System: FreeBSD measurement-factory.com 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #1: Tue Sep 16 12:30:45 MDT 2003 wessels at measurement-factory.com:/usr/obj/usr/src/sys/TMF i386
>Description:
astyle has a bug in parsing *indent=* options.
The attached patch fixes the bug.
The patch comes from http://bugs.gentoo.org/show_bug.cgi?id=43091
I removed some (but not all) whitespace changes.
>How-To-Repeat:
astyle --force-indent=tab=4
>Fix:
apply the patch
--- patch-ae begins here ---
--- astyle_main.cpp 2002-03-07 08:22:30.000000000 +0100
+++ astyle_main.cpp.fixed 2004-02-25 22:05:13.841700600 +0100
@@ -267,22 +267,22 @@
{
manuallySetJavaStyle(formatter);
}
- else if ( IS_OPTIONS(arg, "t", "indent=tab=") )
- {
- int spaceNum = 4;
- string spaceNumParam = GET_PARAMS(arg, "t", "indent=tab=");
- if (spaceNumParam.length() > 0)
- spaceNum = atoi(spaceNumParam.c_str());
- formatter.setTabIndentation(spaceNum, false);
- }
- else if ( IS_OPTIONS(arg, "T", "force-indent=tab=") )
- {
- int spaceNum = 4;
- string spaceNumParam = GET_PARAMS(arg, "T", "force-indent=tab=");
- if (spaceNumParam.length() > 0)
- spaceNum = atoi(spaceNumParam.c_str());
- formatter.setTabIndentation(spaceNum, true);
- }
+ else if ( IS_PARAM_OPTIONS(arg, "t", "indent=tab=") )
+ {
+ int spaceNum = 4;
+ string spaceNumParam = GET_PARAMS(arg, "t", "indent=tab=");
+ if (spaceNumParam.length() > 0)
+ spaceNum = atoi(spaceNumParam.c_str());
+ formatter.setTabIndentation(spaceNum, false);
+ }
+ else if ( IS_PARAM_OPTIONS(arg, "T", "force-indent=tab=") )
+ {
+ int spaceNum = 4;
+ string spaceNumParam = GET_PARAMS(arg, "T", "force-indent=tab=");
+ if (spaceNumParam.length() > 0)
+ spaceNum = atoi(spaceNumParam.c_str());
+ formatter.setTabIndentation(spaceNum, true);
+ }
else if ( IS_PARAM_OPTION(arg, "indent=tab") )
{
formatter.setTabIndentation(4);
--- patch-ae ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list