summaryrefslogtreecommitdiff
path: root/ppdc/ppdc.cxx
diff options
context:
space:
mode:
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2009-06-10 19:02:58 +0000
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2009-06-10 19:02:58 +0000
commit97c9a8d72271152cf71373b9c7fbdc6036b92e89 (patch)
treec5f3bf3b2358f9905597f0f258b244d38ce8d3c0 /ppdc/ppdc.cxx
parent393ac6abae820d62982c8ad9c871f3c1cc59568c (diff)
downloadcups-97c9a8d72271152cf71373b9c7fbdc6036b92e89.tar.gz
Import changes from CUPS 1.4svn-r8704.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1556 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'ppdc/ppdc.cxx')
-rw-r--r--ppdc/ppdc.cxx22
1 files changed, 19 insertions, 3 deletions
diff --git a/ppdc/ppdc.cxx b/ppdc/ppdc.cxx
index 2b006105f..42d09fc0e 100644
--- a/ppdc/ppdc.cxx
+++ b/ppdc/ppdc.cxx
@@ -284,8 +284,7 @@ main(int argc, // I - Number of command-line arguments
if ((pid = fork()) == 0)
{
// Child process comes here...
- close(0);
- dup(fds[0]);
+ dup2(fds[0], 0);
close(fds[0]);
close(fds[1]);
@@ -357,12 +356,29 @@ main(int argc, // I - Number of command-line arguments
* Write the PPD file...
*/
- if (d->write_ppd_file(fp, catalog, locales, src, le))
+ ppdcArray *templocales = locales;
+
+ if (!templocales)
+ {
+ templocales = new ppdcArray();
+ for (ppdcCatalog *tempcatalog = (ppdcCatalog *)src->po_files->first();
+ tempcatalog;
+ tempcatalog = (ppdcCatalog *)src->po_files->next())
+ {
+ tempcatalog->locale->retain();
+ templocales->add(tempcatalog->locale);
+ }
+ }
+
+ if (d->write_ppd_file(fp, catalog, templocales, src, le))
{
cupsFileClose(fp);
return (1);
}
+ if (templocales != locales)
+ templocales->release();
+
cupsFileClose(fp);
}
}