2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-09-04 16:25:21 +00:00

[master] Implement and use new option format type 'k'

Merges in #68.
This commit is contained in:
Thomas Markwalder
2019-12-17 13:59:24 -05:00
parent 79cfe1acf3
commit 9a2f9db55f
11 changed files with 59 additions and 16 deletions

View File

@@ -1631,6 +1631,7 @@ format_has_text(format)
while (*p != '\0') {
switch (*p++) {
case 't':
case 'k':
return 1;
/* These symbols are arbitrary, not fixed or
@@ -1762,6 +1763,7 @@ format_min_length(format, oc)
case 'A': /* Array of all that precedes. */
case 'a': /* Array of preceding symbol. */
case 'Z': /* nothing. */
case 'k': /* key name */
return min_len;
case 'c': /* Compress flag for D atom. */
@@ -1903,7 +1905,9 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
}
hunksize += k;
break;
case 't':
case 'k':
fmtbuf[l + 1] = 0;
numhunk = -2;
break;
@@ -2047,6 +2051,7 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
for (; j < numelem; j++) {
switch (fmtbuf [j]) {
case 't':
case 'k':
/* endbuf-1 leaves room for NULL. */
k = pretty_text(&op, endbuf - 1, &dp,
data + len, emit_quotes);