[MPlayer-dev-eng] octal and hex surprise and perplex

Alan Curry pacman at TheWorld.com
Fri Jun 9 20:23:20 CEST 2006


Kalev Soikonen writes the following:
>
>On Fri, Jun 09, 2006 at 03:44:13AM -0400, Alan Curry wrote:
>>   Playing dvd://08.
>>   The hostname option must be an integer: 08
>>   Don't start a number with zero unless you intend it to be octal
>>   Struct dvd, field hostname parsing error: 08
>
>	mplayer dvd://08-11
>
>already does what a regular ten-fingered person expects.
>

Oh, how horribly inconsistent this is...

>What about arguments like "015", which pass ok but interpret differently
>to what one might expect?

I just hope you'll try 08 or 09 before you work your way up to 015, otherwise
you're gonna be confused.

>
>Maybe it would be wise to deprecate all octals in favor of explicit hex,
>which is unambiguous? Maybe wrap strtol and have -hardcore-C-style-strtol
>and/or -decimal-numbers-only-please kind of flags?

I wouldn't mind losing octal. It's only good for chmod since 9-bit bytes went
out of fashion. I suspect it survives mainly because strtol(...,0) is a
convenient shortcut for accepting hex and decimal, and octal just gets sucked
in as a side effect.

>Ahem, methinks you can't shrug off this problem so easily.

My little hint is easier and didn't anger anyone, so I'll go ahead and commit
it (as a translatable string).



More information about the MPlayer-dev-eng mailing list