You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.5 KiB
52 lines
1.5 KiB
7 years ago
|
diff -up xpdf-3.03/goo/gfile.cc.ext xpdf-3.03/goo/gfile.cc
|
||
|
--- xpdf-3.03/goo/gfile.cc.ext 2011-08-15 17:08:53.000000000 -0400
|
||
|
+++ xpdf-3.03/goo/gfile.cc 2011-08-22 13:43:54.540304026 -0400
|
||
|
@@ -507,32 +507,14 @@ GBool openTempFile(GString **name, FILE
|
||
|
char *s;
|
||
|
int fd;
|
||
|
|
||
|
- if (ext) {
|
||
|
-#if HAVE_MKSTEMPS
|
||
|
- if ((s = getenv("TMPDIR"))) {
|
||
|
- *name = new GString(s);
|
||
|
- } else {
|
||
|
- *name = new GString("/tmp");
|
||
|
- }
|
||
|
- (*name)->append("/XXXXXX")->append(ext);
|
||
|
- fd = mkstemps((*name)->getCString(), strlen(ext));
|
||
|
-#else
|
||
|
- if (!(s = tmpnam(NULL))) {
|
||
|
- return gFalse;
|
||
|
- }
|
||
|
+#if HAVE_MKSTEMP
|
||
|
+ if ((s = getenv("TMPDIR"))) {
|
||
|
*name = new GString(s);
|
||
|
- (*name)->append(ext);
|
||
|
- fd = open((*name)->getCString(), O_WRONLY | O_CREAT | O_EXCL, 0600);
|
||
|
-#endif
|
||
|
} else {
|
||
|
-#if HAVE_MKSTEMP
|
||
|
- if ((s = getenv("TMPDIR"))) {
|
||
|
- *name = new GString(s);
|
||
|
- } else {
|
||
|
- *name = new GString("/tmp");
|
||
|
- }
|
||
|
- (*name)->append("/XXXXXX");
|
||
|
- fd = mkstemp((*name)->getCString());
|
||
|
+ *name = new GString("/tmp");
|
||
|
+ }
|
||
|
+ (*name)->append("/XXXXXX");
|
||
|
+ fd = mkstemp((*name)->getCString());
|
||
|
#else // HAVE_MKSTEMP
|
||
|
if (!(s = tmpnam(NULL))) {
|
||
|
return gFalse;
|
||
|
@@ -540,7 +522,7 @@ GBool openTempFile(GString **name, FILE
|
||
|
*name = new GString(s);
|
||
|
fd = open((*name)->getCString(), O_WRONLY | O_CREAT | O_EXCL, 0600);
|
||
|
#endif // HAVE_MKSTEMP
|
||
|
- }
|
||
|
+
|
||
|
if (fd < 0 || !(*f = fdopen(fd, mode))) {
|
||
|
delete *name;
|
||
|
*name = NULL;
|