I would actually recommend you inverse this, trying to use the UF first (since it's the newest and most generic), then falling back to F (also generic) and then finally looking for Dos/Unix/Mac. Also, since those last three are almost never generated, you'll find the value faster.
Leonard -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Albert Astals Cid Sent: Tuesday, June 30, 2009 5:12 PM To: [email protected] Subject: [poppler] About getFileSpecNameForPlatform Hi, file on bug 22551 is failing on getFileSpecNameForPlatform if (fileSpec->isDict()) { #ifdef WIN32 if (!fileSpec->dictLookup("DOS", &obj1)->isString()) { #else if (!fileSpec->dictLookup("Unix", &obj1)->isString()) { #endif obj1.free(); if (fileSpec->dictLookup("UF", &obj1)->isString ()) { name = obj1.getString()->copy(); } else if (fileSpec->dictLookup("F", &obj1)->isString ()) { name = obj1.getString()->copy(); } else { error(-1, "Illegal file spec in link"); } } obj1.free(); // error } else { error(-1, "Illegal file spec in link"); } The thing is that i seem to miss a else here, i mean if Unix is not found we use UF or F, but if Unix is found shouldn't we do name = obj1.getString()->copy(); Carlos i think this code is yours, is it a typo/bug or am i missing something? Albert _______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler _______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
