[mythtv] Command-line arg processing bad?
Nigel Pearson
nigel at ind.tansu.com.au
Thu Mar 10 06:08:50 UTC 2005
$ mythfrontend -l sdafdsf
mythfrontend: cannot connect to X server
$ mythfrontend -l
mythfrontend: cannot connect to X server
That second invocation should have caused an error, right?
...
for(int argpos = 1; argpos < a.argc(); ++argpos)
...
if (!strcmp(a.argv()[argpos],"-l") ||
!strcmp(a.argv()[argpos],"--logfile"))
{
if (a.argc() > argpos)
^
That will always be true, because argc always includes argv[0] -
the binary's name.
Tell me I am not going mad. Please.
--
Nigel Pearson, nigel at ind.tansu.com.au | "Now the world has gone to bed,
Telstra BI&D, Sydney, Australia | Darkness won't engulf my head,
Office: 8255 4222 Fax: 8255 3153 | I can see by infrared,
Mobile: 0408 664435 Home: 9792 6998 | How I hate the night." -Marvin
More information about the mythtv-dev
mailing list