40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
if (feof(configfp)) {
break;
}
linebuf_ptr = &linebuf[strlen(linebuf) - 1];
while (*linebuf_ptr < ' ' && linebuf_ptr >= linebuf) {
*linebuf_ptr = '\0';
*linebuf_ptr--;
}
linebuf_ptr = &linebuf[0];
while (*linebuf_ptr == ' ') {
*linebuf_ptr++;
}
if (*linebuf_ptr == '#' || *linebuf_ptr == '\0') {
continue;
}
sep = strpbrk(linebuf_ptr, " \t");
cmd = linebuf_ptr;
if (sep != NULL) {
*sep = '\0';
*sep++;
while (*sep == ' ' || *sep == '\t') {
*sep++;
}
value = sep;
} else {
value = NULL;
}
save_lc_errno = lc_errno;
lc_errno = LC_ERR_NONE;
lcpvret = lc_process_var(cmd, NULL, value, LC_FLAGS_VAR);
if (lcpvret < 0) {
if (lc_errno == LC_ERR_NONE) {
PRINTERR_D("Invalid command: \"%s\"", cmd);
lc_errno = LC_ERR_INVCMD;
} else {
PRINTERR_D("Error processing command (command was valid, but an error occured, errno was set)");
}
retval = -1;
} else {
lc_errno = save_lc_errno;
}
}
|
|
|
|
|
>
|
>
>
|
>
|
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
if (feof(configfp)) {
break;
}
linebuf_ptr = &linebuf[strlen(linebuf) - 1];
while (*linebuf_ptr < ' ' && linebuf_ptr >= linebuf) {
*linebuf_ptr = '\0';
linebuf_ptr--;
}
linebuf_ptr = &linebuf[0];
while (*linebuf_ptr == ' ') {
linebuf_ptr++;
}
if (*linebuf_ptr == '#' || *linebuf_ptr == '\0') {
continue;
}
sep = strpbrk(linebuf_ptr, " \t");
cmd = linebuf_ptr;
if (sep != NULL) {
*sep = '\0';
sep++;
while (*sep == ' ' || *sep == '\t') {
sep++;
}
value = sep;
} else {
value = NULL;
}
save_lc_errno = lc_errno;
lc_errno = LC_ERR_NONE;
lcpvret = lc_process_var(cmd, NULL, value, LC_FLAGS_VAR);
if (lcpvret < 0) {
if (lc_errno == LC_ERR_NONE) {
#ifdef DEBUG
fprintf(stderr, "Invalid command: \"%s\"\n", cmd);
#endif
lc_errno = LC_ERR_INVCMD;
} else {
#ifdef DEBUG
fprintf(stderr, "Error processing command (command was valid, but an error occured, errno was set)\n");
#endif
}
retval = -1;
} else {
lc_errno = save_lc_errno;
}
}
|