Skip to content

Commit

Permalink
Support -f option with -a.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Apr 5, 2024
1 parent f9e0e9b commit 5b6bcad
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tools/ippeveprinter.c
@@ -1,7 +1,7 @@
//
// IPP Everywhere printer application for CUPS.
//
// Copyright © 2021-2023 by OpenPrinting.
// Copyright © 2021-2024 by OpenPrinting.
// Copyright © 2020 by the IEEE-ISTO Printer Working Group.
// Copyright © 2010-2021 by Apple Inc.
//
Expand Down Expand Up @@ -454,7 +454,6 @@ main(int argc, // I - Number of command-line args
}

docformats = cupsArrayNewStrings(argv[i], ',');
legacy = true;
break;

case 'F' : // -F output/format
Expand Down Expand Up @@ -1754,13 +1753,17 @@ create_printer(

if (docformats)
{
ipp_attribute_t *attr; // Attribute

// document-format-default
if (!ippFindAttribute(printer->attrs, "document-format-default", IPP_TAG_MIMETYPE))
ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_MIMETYPE), "document-format-default", NULL, "application/octet-stream");

// document-format-supported
if (!ippFindAttribute(printer->attrs, "document-format-supported", IPP_TAG_MIMETYPE))
ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_MIMETYPE, "document-format-supported", num_formats, NULL, formats);
if ((attr = ippFindAttribute(printer->attrs, "document-format-supported", IPP_TAG_MIMETYPE)) != NULL)
ippDeleteAttribute(printer->attrs, attr);

ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_MIMETYPE, "document-format-supported", num_formats, NULL, formats);
}

// generated-natural-language-supported
Expand Down

0 comments on commit 5b6bcad

Please sign in to comment.