monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] bug in option.cc getopt


From: Thomas Keller
Subject: Re: [Monotone-devel] bug in option.cc getopt
Date: Sun, 22 Aug 2010 17:42:51 +0200
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; de; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6

Am 22.08.10 15:04, schrieb Stephen Leake:
> Stephen Leake <address@hidden> writes:
> This line:
> 
>   string err = (F("option '%s' has multiple ambiguous expansions:")
>                 % name).str();
> 
> throws an exception:
> 
> mtn: fatal: boost::io::bad_format_string: boost::bad_format_string: 
> format-string is ill-formed
> 
> Apparently boost 1.34.1 (on MinGW) doesn't accept an empty string in
> this case, while boost 1.42 (on Debian) does? I didn't try to step into
> the boost code.
> 
> 
> mtn 0.48 says this for 'mtn automate identify -':
> 
> mtn: option error: unknown option ''
> 
> So I just added a check for an empty name:
> 
>   if (name.size() == 0)
>     throw unknown_option(name);
> 
> Now all tests are passing on MinGW

Fine!

> Hmm. That may conflict with this change:
> 
>    075540bcf4d90afcc170e6f19b1e930501206fd6
>    2010-08-22T12:13:12  address@hidden
>      * option.cc (getopt): when a user tries to complete "-", we list
>        all available options, but of course all short-named options match
>        then as well, so we need to be more careful and cannot simply set
>        "--" in front of every option name

Actually not, the change I did might not be needed anymore, but the code
still works more correctly now.

Thomas.

-- 
GPG-Key 0x160D1092 | address@hidden | http://thomaskeller.biz
Please note that according to the EU law on data retention, information
on every electronic information exchange might be retained for a period
of six months or longer: http://www.vorratsdatenspeicherung.de/?lang=en

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]