I mailed recently concerning the following runhugs (Version 970410)
error:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
/u/gem/hugs/src$ ./echo Hello World
ERROR: Option string must begin with `+' or `-'
Hugs Error:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
I've discovered the problem: I had the environment variable HUGSPATH
pointing to the old Hugs 1.3 libraries. I had thought this was okay
as the documentation made no mention of HUGSPATH (only HUGSFLAGS) and
running hugs as an interpreter worked (even without HUGSFLAGS setting
the path via the -P flag).
One of the files compiled to make runhugs, server.c, has the following
code:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
readOptions(fromEnv("HUGSPATH",""));
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
within the definition of
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
DLLEXPORT(HugsServerAPI*) initHugsServer(argc, argv)
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
readOptions in hugs.c looks as follows:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
static Void local readOptions(options) /* read options from string */
String options; {
String s;
if (options) {
stringInput(options);
while (s=readFilename()) {
if (*s && !processOption(s)) {
ERRMSG(0) "Option string must begin with `+' or `-'"
EEND;
}
}
}
}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
which contains the error I was receiving, and processOption starts:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
static Bool local processOption(s) /* process string s for options, */
String s; { /* return FALSE if none found. */
Bool state;
if (s[0]=='-')
state = FALSE;
else if (s[0]=='+')
state = TRUE;
else
return FALSE;
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
So, in summary, it seems that runhugs processes HUGSPATH as a series
of flags, as hugs would process HUGSFLAGS. As HUGSPATH was used by
Hugs 1.3 as a colon-separated list of directories, the lack of +/-
flags causes an error. Should HUGSPATH just be replaced with
HUGSFLAGS in the definition of initHugsServer in server.c (line 171)?
The documentation (the DVI file, I can't find it in the HTML
equivalent) reads:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The runhugs program uses the same environment variables to set Hugs
options as the standard Hugs systems.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
which suggests that the above change is correct.
Graeme.