Re: BUG and temporary patch: MHonArc 1.2.x under MSDOS

1996-04-27 12:17:51
At 05:17 PM 4/26/96 -0500, Earl wrote with > :
C.Huygen's problem with reading the mhonarc.db (.mhonarc.db) database file
is a side-effect of using eval on a string with single backslashes in it.
eval treats them as quotes.  This line is the culprit:

        eval qq%require "${OUTDIR}${DIRSEP}${DBFILE}"%;

Special case repair:  This only works when the output directory is the
current directory.  Comment out the original require and insert a new one:

    #       eval qq%require "${OUTDIR}${DIRSEP}${DBFILE}"%;
            eval qq%require $DBFILE%;

I figure the simplest fix would be to use q%% instead of
qq%%  Have you tried this?

Just now.  It worked on my one test case.  This should have less side
effects than the substitution of / as the MS-DOS dirsep as I advised a
second person reporting the problem.

With the qq the variables will be
expanded before passed to eval.  If the string is passed
unexpanded with q, then the variables will not be interpolated
until eval processes them (hence possibly avoiding the backslash

Yes; it was the double level of interpolation/interpretation that was
causing the problem.  Seems necessary in case any outdir or dbfile name
contains a $ (legal in Mac and DOS), as well as \ .

-- regards, SP

<Prev in Thread] Current Thread [Next in Thread>