From f96a70b3ba62c8bfbeb516bfcb84facb2dd49c8f Mon Sep 17 00:00:00 2001 From: Eric Toombs Date: Mon, 23 Mar 2009 23:28:36 -0400 Subject: [PATCH] removes case-insensitive matching of filenames --- poppler/PDFDoc.cc | 39 ++++++++++----------------------------- 1 files changed, 10 insertions(+), 29 deletions(-) diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc index e83652c..b844677 100644 --- a/poppler/PDFDoc.cc +++ b/poppler/PDFDoc.cc @@ -90,40 +90,21 @@ PDFDoc::PDFDoc(GooString *fileNameA, GooString *ownerPassword, fileName = fileNameA; // try to open file - GooString *fn = fileName->copy(); //a modifiable copy of fileName - for (int trial = 1; trial <= 3; trial++) { #ifdef VMS - file = fopen(fn->getCString(), "rb", "ctx=stm"); + file = fopen(fileName->getCString(), "rb", "ctx=stm"); #else - file = fopen(fn->getCString(), "rb"); + file = fopen(fileName->getCString(), "rb"); #endif - if (file != NULL) - // fopen() has succeeded! - break; - + if (file == NULL) { // fopen() has failed. - if (errno != ENOENT || trial == 3) { - /* - * Either an error has occurred other than "No such file or - * directory", or we are on trial 3 and we are out of alternative file - * names. - */ - error(-1, "Couldn't open file '%s': %s.", fileName->getCString(), - strerror(errno)); - errCode = errOpenFile; - // Keep a copy of the errno returned by fopen so that it can be - // referred to later. - fopenErrno = errno; - return; - } - - // fn wasn't found. - if (trial == 1) - fn->lowerCase(); - else //if (trial == 2) implicit; 3 and 1 have already been checked for. - fn->upperCase(); + error(-1, "Couldn't open file '%s': %s.", fileName->getCString(), + strerror(errno)); + errCode = errOpenFile; + // Keep a copy of the errno returned by fopen so that it can be + // referred to later. + fopenErrno = errno; + return; } - delete fn; // create stream obj.initNull(); -- 1.6.0.6