Skip to content

Commit

Permalink
Fix handling of attributes with dashes in the name (Issue #282)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Jun 19, 2023
1 parent d8cb62a commit e895c10
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/ipp-options.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Option support functions for the IPP tools.
//
// Copyright © 2022 by the Printer Working Group.
// Copyright © 2022-2023 by the Printer Working Group.
//
// Licensed under Apache License v2.0. See the file "LICENSE" for more
// information.
Expand Down Expand Up @@ -619,7 +619,12 @@ get_option(const char *name, // I - Attribute name
// Try finding "IPP_NAME" in the environment...
snprintf(temp, sizeof(temp), "IPP_%s", name);
for (ptr = temp + 4; *ptr; ptr ++)
*ptr = (char)toupper(*ptr);
{
if (*ptr == '-')
*ptr = '_';
else
*ptr = (char)toupper(*ptr);
}

if ((value = getenv(temp)) == NULL)
{
Expand Down

0 comments on commit e895c10

Please sign in to comment.