$NetBSD: patch-ai,v 1.3 2006/07/10 20:00:48 dillo Exp $ --- src/daphne.cpp.orig 2005-09-24 16:16:49.000000000 +0200 +++ src/daphne.cpp @@ -36,6 +36,7 @@ // - A common modern computer (i386 Win32, i386 Linux most likely) // No other original hardware (motherboard, power supply, harness) required +#include #include #include "io/my_stdio.h" @@ -391,3 +392,28 @@ unsigned char get_startsilent() return(startsilent); } // end edit + +// added by dillo for pkgsrc +char *find_data_file(const char *name) +{ + static const char *data_path[] = { + ".", + DATA_DIR, + NULL + }; + + int i; + char buf[1024]; + struct stat st; + + for (i=0; data_path[i]; i++) { + snprintf(buf, sizeof(buf), "%s/%s", data_path[i], name); + if (stat(buf, &st) == 0) + return buf; + } + + snprintf(buf, sizeof(buf), "cannot find data file `%s'", name); + printerror(buf); + return "NOSUCHFILE"; +} +// end edit