[prev in list] [next in list] [prev in thread] [next in thread]
List: cups-bugs
Subject: Re: [cups.bugs] [LOW] STR #2514: CUPS DDK 1.2-current: refactor
From: Michael Sweet <mike () easysw ! com>
Date: 2007-09-28 22:56:15
Message-ID: 20070928225615.D64443C68112 () dns ! easysw ! com
[Download RAW message or body]
[STR Closed w/Resolution]
Fixed in Subversion repository.
Link: http://www.cups.org/str.php?L2514
Version: 1.2-current
Fix Version: 1.2-current (r358)
["str2514.patch" (text/plain)]
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);
};
_______________________________________________
cups-bugs mailing list
cups-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/cups-bugs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic