cups/cups-ext.patch

51 lines
1.3 KiB
Diff

--- cups-1.1.22/pdftops/gfile.cxx.ext 2003-11-19 18:17:03.000000000 +0000
+++ cups-1.1.22/pdftops/gfile.cxx 2004-11-29 17:58:13.250694162 +0000
@@ -487,32 +487,14 @@
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;
@@ -520,7 +502,7 @@
*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;
return gFalse;