Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

lpr doesn't work anymore with env variable PRINTER=destination/instance #3485

Closed

Description

@michaelrsweet

Version: 1.4.2
CUPS.org User: michele

If I set the environment variable PRINTER as follow

export PRINTER=destination/instance

lpr returns the following error message:

michele@asterix ~$ export PRINTER=isgmath/w
michele@asterix ~$ lpr
lpr: Error - PRINTER environment variable names non-existent destination "isgmath/w"!

But if the variable is set to only "destination" (without instance) or "lpr" is run with the "-P" parameter, then it works, i.e:

michele@asterix ~$ export PRINTER=isgmath
michele@asterix ~$ lpr
michele@asterix ~$ lpr -Pisgmath/w
both work.

Ist this a feature or a bug?

Grazie,
Michele

PS: the "Dest" isgmath/w is defined in the lpoptions file

Activity

  1. michaelrsweet commented on Jan 27, 2010

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: mike

    That's not an error message we produce in CUPS, so I suspect you are running a different lpr command.

  2. michaelrsweet commented on Jan 27, 2010

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: michele

    You can find the mentioned string in cups-1.4.2-source.tar.g :

    grep -rl 'environment variable names non-existent destination' .

    ./locale/cups.pot
    ./locale/cups_da.po
    ./locale/cups_de.po
    ./locale/cups_es.po
    ./locale/cups_eu.po
    ...

  3. michaelrsweet commented on Jan 30, 2010

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: mike

    OK, not sure why I wasn't able to find the string... Looking at it...

  4. michaelrsweet commented on Aug 13, 2010

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: mike

    Fixed in Subversion repository.

  5. michaelrsweet commented on Aug 13, 2010

    @michaelrsweet
    ContributorAuthor

    "str3485.patch":

    Index: cups/dest.c

    --- cups/dest.c (revision 9236)
    +++ cups/dest.c (working copy)
    @@ -502,8 +502,20 @@
    set_as_default = 1;
    name = _cupsUserDefault(defname, sizeof(defname));

    • if (!name && home)
    • if (name)
      {
    •  char _ptr;           /_ Temporary pointer... */
      
    •  if ((ptr = strchr(defname, '/')) != NULL)
      
    •  {
      
    •    *ptr++   = '\0';
      
    • instance = ptr;
    •  }
      
    •  else
      
    •    instance = NULL;
      
    • }
    • else if (home)
    • {
      /*
    • No default in the environment, try the user's lpoptions files...
      */
  6. added this to the Stable milestone on Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions