[GHC] #473: getOpt' checks "non-option options"

GHC trac at galois.com
Sat May 6 07:09:11 EDT 2006


#473: getOpt' checks "non-option options"
-----------------------------+----------------------------------------------
  Reporter:  nobody          |          Owner:  nobody 
      Type:  bug             |         Status:  closed 
  Priority:  normal          |      Milestone:         
 Component:  libraries/base  |        Version:  6.4.1  
  Severity:  normal          |     Resolution:  fixed  
  Keywords:                  |             Os:  Unknown
Difficulty:  Unknown         |   Architecture:  Unknown
-----------------------------+----------------------------------------------
Changes (by panne):

  * architecture:  => Unknown
  * resolution:  None => fixed
  * difficulty:  => Unknown
  * status:  assigned => closed
  * os:  => Unknown

Old description:

> {{{
> When given RequireOrder the getOpt' function should not
> parse options
> following a non-option.  But currently (as of version
> 6.4.1 of ghc) it
> does.  E.g. when parsing with RequireOrder and if
> invalid-opt3 is not a
> recognized option then the following produces an error:
>
>   progname --valid-opt1 --valid-opt2 non-opt --invalid-opt3
>
> However, anything after non-opt should not be parsed.
> The problem can be
> fixed as follows:
>
> 164c164
> <          procNextOpt (NonOpt x)   RequireOrder      =
> ([],x:rest,us,[])
> ---
> >          procNextOpt (NonOpt x)   RequireOrder      =
> ([],x:rest,[],[])
>
> Best
> Sebastian
>
> }}}

New description:

 {{{
 When given RequireOrder the getOpt' function should not
 parse options
 following a non-option.  But currently (as of version
 6.4.1 of ghc) it
 does.  E.g. when parsing with RequireOrder and if
 invalid-opt3 is not a
 recognized option then the following produces an error:

   progname --valid-opt1 --valid-opt2 non-opt --invalid-opt3

 However, anything after non-opt should not be parsed.
 The problem can be
 fixed as follows:

 164c164
 <          procNextOpt (NonOpt x)   RequireOrder      =
 ([],x:rest,us,[])
 ---
 >          procNextOpt (NonOpt x)   RequireOrder      =
 ([],x:rest,[],[])

 Best
 Sebastian

 }}}

Comment:

 The bug has already been fixed in the 6.4.2 branch, and it is now fixed in
 the HEAD, too.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/473>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list