diff options
Diffstat (limited to 'ppdc/ppdc.cxx')
-rw-r--r-- | ppdc/ppdc.cxx | 22 |
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); } } |