Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lpoptions crashes when adding/removing options and there are no printers #2295

Closed
michaelrsweet opened this issue Mar 17, 2007 · 2 comments
Closed
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.2-current
CUPS.org User: mike

The lpoptions command currently does not handle the "no printers" case when adding or removing options.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"str2295.patch":

Index: lpoptions.c

--- lpoptions.c (revision 6342)
+++ lpoptions.c (working copy)
@@ -174,6 +174,9 @@
if ((dest = cupsGetDest(NULL, NULL, num_dests, dests)) == NULL)
dest = dests;

  •     if (dest == NULL)
    
  •   _cupsLangPuts(stderr, _("lpoptions: No printers!?!\n"));
    
    • for (j = 0; j < dest->num_options; j ++)
      
      if (cupsGetOption(dest->options[j].name, num_options, options) == NULL)
      num_options = cupsAddOption(dest->options[j].name,
      @@ -244,6 +247,9 @@
      if ((dest = cupsGetDest(NULL, NULL, num_dests, dests)) == NULL)
      dest = dests;
  •     if (dest == NULL)
    
  •   _cupsLangPuts(stderr, _("lpoptions: No printers!?!\n"));
    
    • for (j = 0; j < dest->num_options; j ++)
      
      if (cupsGetOption(dest->options[j].name, num_options, options) == NULL)
      num_options = cupsAddOption(dest->options[j].name,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant