Remove useless commentary from environment and argument processing.

This commit is contained in:
Adam Jackson 2008-02-01 16:03:01 +11:00
parent f3b3b37ec6
commit ef77e4c441

View File

@ -2002,18 +2002,6 @@ enum BadCode {
#define BUGADDRESS "xorg@freedesktop.org" #define BUGADDRESS "xorg@freedesktop.org"
#endif #endif
#define ARGMSG \
"\nIf the arguments used are valid, and have been rejected incorrectly\n" \
"please send details of the arguments and why they are valid to\n" \
"%s. In the meantime, you can start the Xserver as\n" \
"the \"super user\" (root).\n"
#define ENVMSG \
"\nIf the environment is valid, and have been rejected incorrectly\n" \
"please send details of the environment and why it is valid to\n" \
"%s. In the meantime, you can start the Xserver as\n" \
"the \"super user\" (root).\n"
void void
CheckUserParameters(int argc, char **argv, char **envp) CheckUserParameters(int argc, char **argv, char **envp)
{ {
@ -2060,10 +2048,6 @@ CheckUserParameters(int argc, char **argv, char **envp)
/* Check for bad environment variables and values */ /* Check for bad environment variables and values */
#if REMOVE_ENV_LD #if REMOVE_ENV_LD
while (envp[i] && (strncmp(envp[i], "LD", 2) == 0)) { while (envp[i] && (strncmp(envp[i], "LD", 2) == 0)) {
#ifdef ENVDEBUG
ErrorF("CheckUserParameters: removing %s from the "
"environment\n", strtok(envp[i], "="));
#endif
for (j = i; envp[j]; j++) { for (j = i; envp[j]; j++) {
envp[j] = envp[j+1]; envp[j] = envp[j+1];
} }
@ -2071,10 +2055,6 @@ CheckUserParameters(int argc, char **argv, char **envp)
#endif #endif
if (envp[i] && (strlen(envp[i]) > MAX_ENV_LENGTH)) { if (envp[i] && (strlen(envp[i]) > MAX_ENV_LENGTH)) {
#if REMOVE_LONG_ENV #if REMOVE_LONG_ENV
#ifdef ENVDEBUG
ErrorF("CheckUserParameters: removing %s from the "
"environment\n", strtok(envp[i], "="));
#endif
for (j = i; envp[j]; j++) { for (j = i; envp[j]; j++) {
envp[j] = envp[j+1]; envp[j] = envp[j+1];
} }
@ -2127,20 +2107,16 @@ CheckUserParameters(int argc, char **argv, char **envp)
return; return;
case UnsafeArg: case UnsafeArg:
ErrorF("Command line argument number %d is unsafe\n", i); ErrorF("Command line argument number %d is unsafe\n", i);
ErrorF(ARGMSG, BUGADDRESS);
break; break;
case ArgTooLong: case ArgTooLong:
ErrorF("Command line argument number %d is too long\n", i); ErrorF("Command line argument number %d is too long\n", i);
ErrorF(ARGMSG, BUGADDRESS);
break; break;
case UnprintableArg: case UnprintableArg:
ErrorF("Command line argument number %d contains unprintable" ErrorF("Command line argument number %d contains unprintable"
" characters\n", i); " characters\n", i);
ErrorF(ARGMSG, BUGADDRESS);
break; break;
case EnvTooLong: case EnvTooLong:
ErrorF("Environment variable `%s' is too long\n", e); ErrorF("Environment variable `%s' is too long\n", e);
ErrorF(ENVMSG, BUGADDRESS);
break; break;
case OutputIsPipe: case OutputIsPipe:
ErrorF("Stdout and/or stderr is a pipe\n"); ErrorF("Stdout and/or stderr is a pipe\n");
@ -2150,8 +2126,6 @@ CheckUserParameters(int argc, char **argv, char **envp)
break; break;
default: default:
ErrorF("Unknown error\n"); ErrorF("Unknown error\n");
ErrorF(ARGMSG, BUGADDRESS);
ErrorF(ENVMSG, BUGADDRESS);
break; break;
} }
FatalError("X server aborted because of unsafe environment\n"); FatalError("X server aborted because of unsafe environment\n");