Handling argc==0 in the kernel
Handling argc==0 in the kernel
Posted Jan 28, 2022 16:57 UTC (Fri) by corbet (editor, #1)In reply to: Handling argc==0 in the kernel by larkey
Parent article: Handling argc==0 in the kernel
Allowing argv[0]==NULL would indeed allow the "old as Unix" pattern to work. But it also works fine now in the argv==NULL case. The pattern, perhaps equally old, that fails is:
for (arg = argv + 1; *arg; arg++)
/* ... */
...and that pattern will still fail badly with argv[0]==NULL.
