httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@ai.mit.edu (Robert S. Thau)
Subject Re: Setting UserDir to "disabled" doesn't work?
Date Sat, 07 Oct 1995 17:10:17 GMT
      It would seem that if the UserDir argument was set to "disabled",
  a NULL pointer would be passed to set_module_config (to disable tilde
  expansion of home directories in URL's).

Correct.  Reversing the sense of the comparison would cause all arguments
*other* than "disabled" to cause a NULL pointer to be passed.  As to the
idiom:

    if (!strcasecmp (arg, "disabled")) arg = NULL;

strcasecmp, like strcmp, returns *zero* on equality (-1 for less, +1 for
greater, by ASCII lexical comparison, though strcasecmp() is case insensitive).
Thus, the common idiom when comparing strings for equality:

    if (!strcmp(..., "whatever")) ...

which is in all respects equivalent to:

    if (strcmp(..., "whatever") != 0) ...

Sheesh.

rst

Mime
View raw message