]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Store next pointer before removing printer from class, since the class
authorandy <andy@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 15 Mar 2001 19:26:23 +0000 (19:26 +0000)
committerandy <andy@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 15 Mar 2001 19:26:23 +0000 (19:26 +0000)
might be removed...

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@1634 7a7537e8-13f0-0310-91df-b6672ffda945

scheduler/classes.c
scheduler/printers.c

index 8060711ae35afff1bc4936ab01683e2ee17d76fe..eaab1ebe695d9737833ce7dc833b85c22cff4945 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: classes.c,v 1.32 2001/02/09 18:40:34 mike Exp $"
+ * "$Id: classes.c,v 1.33 2001/03/15 19:26:22 andy Exp $"
  *
  *   Printer class routines for the Common UNIX Printing System (CUPS).
  *
@@ -201,7 +201,9 @@ DeletePrinterFromClass(printer_t *c,        /* I - Class to delete from */
 void
 DeletePrinterFromClasses(printer_t *p) /* I - Printer to delete */
 {
-  printer_t    *c;                     /* Pointer to current class */
+  printer_t    *c,                     /* Pointer to current class */
+               *prev,
+               *next;                  /* Pointer to next class */
 
 
  /*
@@ -209,9 +211,13 @@ DeletePrinterFromClasses(printer_t *p)     /* I - Printer to delete */
   * from each class listed...
   */
 
-  for (c = Printers; c != NULL; c = c->next)
+  for (c = Printers, prev = NULL; c != NULL; prev = c, c = next)
+  {
+    next = c->next;
+
     if (c->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT))
       DeletePrinterFromClass(c, p);
+  }
 }
 
 
@@ -619,5 +625,5 @@ SaveAllClasses(void)
 
 
 /*
- * End of "$Id: classes.c,v 1.32 2001/02/09 18:40:34 mike Exp $".
+ * End of "$Id: classes.c,v 1.33 2001/03/15 19:26:22 andy Exp $".
  */
index ec4a474bd1fe2cd497d4de7232fbad99407e330e..b20f926cce213c9fa2ba8bdac6f7d9f5629e6556 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: printers.c,v 1.90 2001/03/14 13:45:35 mike Exp $"
+ * "$Id: printers.c,v 1.91 2001/03/15 19:26:23 andy Exp $"
  *
  *   Printer routines for the Common UNIX Printing System (CUPS).
  *
@@ -297,7 +297,6 @@ DeletePrinter(printer_t *p) /* I - Printer to delete */
   else
     prev->next = p->next;
 
-
  /*
   * Stop printing on this printer...
   */
@@ -1782,5 +1781,5 @@ write_printcap(void)
 
 
 /*
- * End of "$Id: printers.c,v 1.90 2001/03/14 13:45:35 mike Exp $".
+ * End of "$Id: printers.c,v 1.91 2001/03/15 19:26:23 andy Exp $".
  */