return line;
}
+char *dir = 0;
+
+FILE *
+scanopen (char *file)
+{
+ FILE *f;
+
+ f = fopen (file, "r");
+ if (!f && dir)
+ {
+ char path[1024];
+
+ strcpy (path, dir);
+ strcat (path, "/");
+ strcat (path, file);
+ f = fopen (path, "r");
+ }
+ return f;
+}
+
/*
* build a single charset from a source file
*
end = strlen (file);
if (file[end-1] == '\n')
file[end-1] = '\0';
- f = fopen (file, "r");
+ f = scanopen (file);
if (!f)
fatal (file, 0, "can't open");
c = scan (f, file);
while (*++argv)
{
+ if (!strcmp (*argv, "-d"))
+ {
+ dir = *++argv;
+ continue;
+ }
if (i == MAX_LANG)
fatal (*argv, 0, "Too many languages");
files[i++] = *argv;
i = 0;
while (files[i])
{
- f = fopen (files[i], "r");
+ f = scanopen (files[i]);
if (!f)
fatal (files[i], 0, strerror (errno));
sets[i] = scan (f, files[i]);