81762, r=jag, sr=sfraser, remove uses of PL_strlen with testing for null and non-empty string, also change const char* to static const char[] so that we can use sizeof-1 instead of PL_strlen

git-svn-id: svn://10.0.0.236/trunk@107047 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pchen%netscape.com
2001-11-02 02:55:56 +00:00
parent 72681d9d8a
commit 28643e60a9
2 changed files with 10 additions and 10 deletions

View File

@@ -227,27 +227,27 @@ OSErr nsMacCommandLine::HandleOpenOneDoc(const FSSpec& inFileSpec, OSType inFile
Boolean foundArgs = false;
Boolean foundEnv = false;
char chars[1024];
const char* kCommandLinePrefix = "ARGS:";
const char* kEnvVarLinePrefix = "ENV:";
static const char kCommandLinePrefix[] = "ARGS:";
static const char kEnvVarLinePrefix[] = "ENV:";
s.readline(chars, sizeof(chars));
do
{ // See if there are any command line or environment var settings
if (PL_strstr(chars, kCommandLinePrefix) == chars)
{
(void)AddToCommandLine(chars + PL_strlen(kCommandLinePrefix));
(void)AddToCommandLine(chars + sizeof(kCommandLinePrefix) - 1);
foundArgs = true;
}
else if (PL_strstr(chars, kEnvVarLinePrefix) == chars)
{
(void)AddToEnvironmentVars(chars + PL_strlen(kEnvVarLinePrefix));
(void)AddToEnvironmentVars(chars + sizeof(kEnvVarLinePrefix) - 1);
foundEnv = true;
}
// Clear the buffer and get the next line from the command line file
chars[0] = '\0';
s.readline(chars, sizeof(chars));
} while (PL_strlen(chars));
} while (chars && (chars[0] != '\0'));
// If we found any environment vars we need to re-init NSPR's logging
// so that it knows what the new vars are