-/* easier to do this than cope with variations in where the library lives */
-int yywrap(void) {return 1;}
+char *prependdir (const char *file, const char *dir)
+/* if a filename is relative to dir, convert it to an absolute path */
+{
+ char *newfile;
+ if (!file[0] || /* null path */
+ file[0] == '/' || /* absolute path */
+ strcmp(file, "-") == 0 || /* stdin/stdout */
+ !dir[0]) /* we don't HAVE_GETCWD */
+ return xstrdup (file);
+ newfile = (char *)xmalloc (strlen (dir) + 1 + strlen (file) + 1);
+ if (dir[strlen(dir) - 1] != '/')
+ sprintf (newfile, "%s/%s", dir, file);
+ else
+ sprintf (newfile, "%s%s", dir, file);
+ return newfile;
+}