Short: Evermore crashes on not-found includes
Date: Sat, 13 May 2000 14:17:05 +0200
From: Lothar Ludwig <lludwig@informatik.uni-tuebingen.de>
Type: Bug
State: Done - fixed in 3.2.8-dev.213


in Evermore schmiert mir der Driver ab, wenn ich
mit #include "../xxx.h"  ein file include, das nicht existiert. 
Plattform: Solaris2.7, Compat driver, die Settings hast du ja da.
< > -includes zeigen dieses Problem nicht.


Hier die Ausschnitte aus dem Master:


set_driver_hook(H_INCLUDE_DIRS, #'get_include_dir );
private string *include_dirs =         ({ "sys/", "include/", "~/" });

string get_include_dir(string included, string includer) {
  string path;

  for (int i = sizeof(include_dirs); i; i--) {
    path = include_dirs[<i] + included;

    if (path[0] == '~') {
      // included by a file with an owner?
      if ((includer[0..7] == "players/") || (includer[0..7] == "domains/")) {
        path[0..0] = implode(explode(includer, "/")[0..1], "/");
      }
        else {
        // included by a mudlib file
          continue;
        }
    }
    // is this file existent?
    if (file_size("/" + path) >= 0) {
      // we return the file
      return path;
    }
  }
  return null;
}



Der Fehler tritt zum Beispiel auf, wenn ich unter
/players/fangorn/work/bla.c ein #include "../blubber.h" mache, wenn das 
blubber.h dort nicht existiert. Dann dumped der driver.

-- Analysis --

Create a file /players/fangorn/work/bla.c containing just the include
statement, and let it load e.g. from the town square. On BeOS you'll get the
error message 'Cannot #include '../blubber.h' line 1 near <garbage>'.

The lex_error_context() was not guarded against end-of-buffer or -file
conditions here, which might have causes the crash on Solaris.

Other than that, the problem was not reproducible.
