Skip to content

Commit c1fcfbb

Browse files
committed
Log ServerAlias values that are added (Issue #1390)
1 parent c3518d7 commit c1fcfbb

1 file changed

Lines changed: 18 additions & 12 deletions

File tree

scheduler/conf.c

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Configuration routines for the CUPS scheduler.
33
*
4-
* Copyright © 2020-2025 by OpenPrinting.
4+
* Copyright © 2020-2026 by OpenPrinting.
55
* Copyright © 2007-2018 by Apple Inc.
66
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
77
*
@@ -3477,20 +3477,26 @@ read_cupsd_conf(cups_file_t *fp) /* I - File to read from */
34773477

34783478
while (*value)
34793479
{
3480-
size_t valuelen; /* Length of value */
3480+
// Extract a single alias name...
3481+
char *start; // Start of alias name
34813482

3482-
for (valuelen = 0; value[valuelen]; valuelen ++)
3483-
if (_cups_isspace(value[valuelen]) || value[valuelen] == ',')
3484-
{
3485-
value[valuelen ++] = '\0';
3486-
break;
3487-
}
3483+
while (*value && (isspace(*value & 255) || *value == ','))
3484+
value ++;
34883485

3489-
cupsdAddAlias(ServerAlias, value);
3486+
start = value;
34903487

3491-
for (value += valuelen; *value; value ++)
3492-
if (!_cups_isspace(*value) || *value != ',')
3493-
break;
3488+
while (*value && !isspace(*value & 255) && *value != ',')
3489+
value ++;
3490+
3491+
if (*value)
3492+
*value++ = '\0';
3493+
3494+
if (*start)
3495+
{
3496+
// Add this one...
3497+
cupsdAddAlias(ServerAlias, start);
3498+
cupsdLogMessage(CUPSD_LOG_DEBUG, "Added ServerAlias '%s'.", start);
3499+
}
34943500
}
34953501
}
34963502
else if (!_cups_strcasecmp(line, "FilterNice") && value)

0 commit comments

Comments
 (0)