--- glkzip/fileio.c.orig Sun Jul 1 21:29:44 2001 +++ glkzip/fileio.c Sun Jul 1 21:30:25 2001 @@ -154,7 +154,21 @@ /* The following three lines are what used to here. --Z */ gfp = fopen (storyname, "rb"); if (gfp == NULL && storyname[0] != '/') { - /* Try the magic path variable. */ + /* Try the new magic path variable first. */ + char *classpath = getenv("ZCODE_PATH"); + if (classpath && strlen(classpath) > 0) { + char *p; + p = strtok(classpath, ":"); + while (p && !gfp) { + char classfile[FILENAME_MAX+1]; + sprintf(classfile, "%s/%s", p, storyname); + gfp = fopen (classfile, "rb"); + p = strtok(NULL, ":"); + } + } + } + if (gfp == NULL && storyname[0] != '/') { + /* Try the original magic path variable second. */ char *classpath = getenv("INFOCOM_PATH"); if (classpath && strlen(classpath) > 0) { char *p;