[comp.sources.bugs] E - the friendly vi frontend. BUG & FIX.

tcjones@watdragon.waterloo.edu (speedboat jones) (02/11/89)

Here are two short fixes to e version 1.3 that appeared two days ago
in comp.sources.unix. There are SysV patches in the works too.
Thanks to Ken Yap for pointing out these problems and solutions.
Sorry these aren't patch patches. Ho hum.

Terry Jones.

Fix #1. 
delete from lines 78 up to (and including) 98 in read_hist.c
They look like this...

    /*
     * Make sure that the first line of the history starts with a '/'
     * This way we know we are not dealing with an old-style (pre version 1.3)
     * history file. The error message here is unsatisfactory - it should make
     * a better attempt to find out what's wrong and point them to the 
     * script for converting to the new format etc etc. Fortunately I'm the
     * only person in the world who uses e and so it's not a problem.
     *
     */

    if (!fgets(line, MAXPATHLEN, hist_fp)){
        e_error("Could not read first line of '%s'.\n", ehist);
    }

    if (line[0] != '/'){
        e_error("The history (%s) is munged. It is not in version %s format.",
            ehist, VERSION);
    }

    ok_fprintf(tmp_fp, "%s", line);


Fix #2. 
line 159 in e.c says abandon();
On the next line put exit(0);
i.e. the case for '.' should not fall through in this case.


So this...

    if ((*v)[1] == '\0'){
        register i;

        check_hist();
        for (i = 0; i < hist_count; i++){
            ok_fprintf(stderr, "\t[%d]: %s\n",
                hist_count - i - 1, hist[i]);
        }
        abandon();
    }


becomes this...

    if ((*v)[1] == '\0'){
        register i;

        check_hist();
        for (i = 0; i < hist_count; i++){
            ok_fprintf(stderr, "\t[%d]: %s\n",
                hist_count - i - 1, hist[i]);
        }
        abandon();
        exit(0);
    }