Replacement su for SCO Unix
Joachim Ott Munich-Germany
ott at guug.guug.de
Sun Sep 30 17:17:42 AEST 1990
In article <bashsco at dce.ie>, em at dce.ie (Eamonn McManus) writes:
> ...
> X const char *user = "root", *shell = NULL;
^^^^^^^^^^^^^
> ...
> X The stupid Microsoft compiler warns about the ?: below. Ignore it.
> X Better still, use GNU C. */
> X su(pwd, login, shell ? shell : pwd->pw_shell, argv + i - 1);
^^^^^^^
Not really stupid (i must admit to microsoft). 'shell ?' means
'shell != 0' and *not* 'shell != NULL'. You should not rely on
NULL being the same as 0. Try the line with '(shell != NULL) ?',
the warning should be gone.
Tell GNU-people to fix this in their compiler.
More information about the Comp.unix.sysv386
mailing list