-static GString* qualify_filename(GString*path, GString*filename)
-{
- GString*fullpath = 0;
- char*prefix = "/usr/local/share/xpdf/";
-
- if (filename->getChar(0) != '\\' && filename->getChar(0) != '/') {
- /* relative path */
- fullpath = path->copy();
- fullpath->append(filename);
- } else if (!strncmp(filename->getCString(), prefix, strlen(prefix))) {
- /* xpdf default path */
- char*s = strchr(filename->getCString()+strlen(prefix), '/');
- if(s) {
- fullpath = path->copy();
- fullpath->append(s+1);
- } else {
- fullpath = filename->copy();
- }
- } else {
- /* absolute path */
- fullpath = filename->copy();
- }
- printf("%s -%s-> %s\n", filename->getCString(), path->getCString(), fullpath->getCString());
- return fullpath;
-}
-