Index: ppdc/ppdc-source.cxx =================================================================== --- ppdc/ppdc-source.cxx (revision 355) +++ ppdc/ppdc-source.cxx (working copy) @@ -2125,7 +2125,8 @@ void ppdcSource::scan_file(ppdcFile *fp, // I - File to read - ppdcDriver *td) // I - Driver template + ppdcDriver *td, // I - Driver template + bool inc) // I - Including? { ppdcDriver *d; // Current driver ppdcGroup *g, // Current group @@ -2139,7 +2140,10 @@ // Initialize things as needed... - d = new ppdcDriver(td); + if (inc && td) + d = td; + else + d = new ppdcDriver(td); if ((general = d->find_group("General")) == NULL) { @@ -2220,7 +2224,7 @@ { // Open the include file, scan it, and then close it... incfile = new ppdcFile(incname); - scan_file(incfile, d); + scan_file(incfile, d, true); delete incfile; } else @@ -2750,17 +2754,20 @@ } // Done processing this block, is there anything to save? - if (!d->pc_file_name || !d->model_name || !d->manufacturer || !d->version || - !d->sizes->count) + if (!inc) { - // Nothing to save... - d->release(); + if (!d->pc_file_name || !d->model_name || !d->manufacturer || !d->version || + !d->sizes->count) + { + // Nothing to save... + d->release(); + } + else + { + // Got a driver, save it... + drivers->add(d); + } } - else - { - // Got a driver, save it... - drivers->add(d); - } } Index: ppdc/ppdc.h =================================================================== --- ppdc/ppdc.h (revision 354) +++ ppdc/ppdc.h (working copy) @@ -464,7 +464,7 @@ int import_ppd(const char *f); int quotef(cups_file_t *fp, const char *format, ...); void read_file(const char *f); - void scan_file(ppdcFile *fp, ppdcDriver *td = 0); + void scan_file(ppdcFile *fp, ppdcDriver *td = 0, bool inc = false); ppdcVariable *set_variable(const char *name, const char *value); int write_file(const char *f); };