[poppler] poppler/goo: gfile.cc,1.2,1.3 gfile.h,1.1.1.1,1.2
Kristian Høgsberg
krh at kemper.freedesktop.org
Mon Sep 18 21:39:10 PDT 2006
Update of /cvs/poppler/poppler/goo
In directory kemper:/tmp/cvs-serv6141/goo
Modified Files:
gfile.cc gfile.h
Log Message:
2006-09-19 Kristian Høgsberg <krh at redhat.com>
* poppler/GlobalParams.cc: Add scanEncodingDirs() to automatically
scan in any encodings found under ${datadir}/poppler.
* m4/define-dir.m4: New file, adds AC_DEFINE_DIR macro.
Index: gfile.cc
===================================================================
RCS file: /cvs/poppler/poppler/goo/gfile.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gfile.cc 2 Feb 2006 22:50:01 -0000 1.2
+++ gfile.cc 19 Sep 2006 04:39:08 -0000 1.3
@@ -576,15 +576,15 @@
char *p;
#elif defined(WIN32)
int fa;
- GooString *s;
#elif defined(ACORN)
#else
struct stat st;
- GooString *s;
#endif
name = new GooString(nameA);
dir = gFalse;
+ fullPath = new GooString(dirPath);
+ appendToPath(fullPath, nameA);
if (doStat) {
#ifdef VMS
if (!strcmp(nameA, "-") ||
@@ -592,21 +592,19 @@
dir = gTrue;
#elif defined(ACORN)
#else
- s = new GooString(dirPath);
- appendToPath(s, nameA);
#ifdef WIN32
- fa = GetFileAttributes(s->getCString());
+ fa = GetFileAttributes(fullPath->getCString());
dir = (fa != 0xFFFFFFFF && (fa & FILE_ATTRIBUTE_DIRECTORY));
#else
- if (stat(s->getCString(), &st) == 0)
+ if (stat(fullPath->getCString(), &st) == 0)
dir = S_ISDIR(st.st_mode);
#endif
- delete s;
#endif
}
}
GDirEntry::~GDirEntry() {
+ delete fullPath;
delete name;
}
@@ -678,10 +676,10 @@
struct dirent *ent;
e = NULL;
if (dir) {
- ent = readdir(dir);
- if (ent && !strcmp(ent->d_name, ".")) {
+ do {
ent = readdir(dir);
}
+ while (ent && (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, "..")));
if (ent) {
e = new GDirEntry(path->getCString(), ent->d_name, doStat);
}
Index: gfile.h
===================================================================
RCS file: /cvs/poppler/poppler/goo/gfile.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- gfile.h 3 Mar 2005 19:45:58 -0000 1.1.1.1
+++ gfile.h 19 Sep 2006 04:39:08 -0000 1.2
@@ -104,11 +104,13 @@
GDirEntry(char *dirPath, char *nameA, GBool doStat);
~GDirEntry();
GooString *getName() { return name; }
+ GooString *getFullPath() { return fullPath; }
GBool isDir() { return dir; }
private:
GooString *name; // dir/file name
+ GooString *fullPath;
GBool dir; // is it a directory?
};
More information about the poppler
mailing list