/*@modifies fileSystem, internalState, *p_passThroughArgs@*/ ;
static void loadrc (FILE *p_rcfile, cstringSList *p_passThroughArgs)
- /*@modifies *p_passThroughArgs@*/
+ /*@modifies *p_passThroughArgs, p_rcfile@*/
/*@ensures closed p_rcfile@*/ ;
static void describeVars (void);
{
cstring home = osd_getHomeDir ();
cstring fname = cstring_undefined;
- FILE *rcfile;
bool defaultf = TRUE;
bool nof = FALSE;
{
defaultf = FALSE;
fname = cstring_fromChars (argv[i]);
- readOptionsFile (fname, &passThroughArgs, TRUE);
+ (void) readOptionsFile (fname, &passThroughArgs, TRUE);
}
else
llfatalerror
homename, altname, homename),
g_currentloc);
}
+
+ cstring_free (homename);
+ cstring_free (altname);
}
}
}
}
else
+ {
if (!isQuiet)
{
llmsg (message ("Finished checking --- %sno code warnings",
specErrors));
}
+ }
}
else
{
if (context_getFlag (FLG_SHOWSCAN))
{
- lldiagmsg (message ("< reading options from %s >",
+ lldiagmsg (message ("< reading options from %q >",
fileloc_outputFilename (g_currentloc)));
}
void
loadrc (/*:open:*/ FILE *rcfile, cstringSList *passThroughArgs)
+ /*@modifies rcfile@*/
/*@ensures closed rcfile@*/
{
char *s = mstring_create (MAX_LINE_LENGTH);
{
DPRINTF (("Set value flag: %s", extra));
setValueFlag (opt, extra);
- cstring_free (extra);
}
else if (opt == FLG_OPTF)
{
llassert (inputStream_isUndefined (initFile));
initFile = inputStream_create
- (extra,
+ (cstring_copy (extra),
cstring_makeLiteralTemp (LCLINIT_SUFFIX),
FALSE);
-# else
- cstring_free (extra);
# endif
}
else if (flagcode_hasString (opt))
{
+ DPRINTF (("Here: %s", extra));
+
+ /*
+ ** If it has "'s, we need to remove them.
+ */
+
if (cstring_firstChar (extra) == '\"')
{
if (cstring_lastChar (extra) == '\"')
{
- char *extras = cstring_toCharsSafe (extra);
-
- llassert (extras[strlen(extras) - 1] == '\"');
- extras[strlen(extras) - 1] = '\0';
- extra = cstring_fromChars (extras + 1);
- DPRINTF (("Remove quotes: %s", extra));
+ cstring unquoted = cstring_copyLength
+ (cstring_toCharsSafe (cstring_suffix (extra, 1)),
+ cstring_length (extra) - 2);
+
+ DPRINTF (("string flag: %s -> %s", extra, unquoted));
+ setStringFlag (opt, unquoted);
+ cstring_free (extra);
}
else
{
message ("Unmatched \" in option string: %s",
extra),
g_currentloc);
+ setStringFlag (opt, extra);
}
}
-
- setStringFlag (opt, extra);
+ else
+ {
+ DPRINTF (("No quotes: %s", extra));
+ setStringFlag (opt, extra);
+ }
+
+ extra = cstring_undefined;
}
else
{
- cstring_free (extra);
BADEXIT;
}
}
+
+ cstring_free (extra);
}
else
{
if (!(osd_fileIsReadable (ppfname)))
{
- lldiagmsg (message ("Cannot open file: %s", osd_outputPath (ppfname)));
+ lldiagmsg (message ("Cannot open file: %q", osd_outputPath (ppfname)));
ppfname = cstring_undefined;
}