| 1172 | } |
| 1173 | |
| 1174 | static int cfg_trim_line(char *buf) |
| 1175 | { |
| 1176 | char *start, *end; |
| 1177 | /* |
| 1178 | * Leading and trailing white space is eliminated completely |
| 1179 | */ |
| 1180 | start = buf; |
| 1181 | while (apr_isspace(*start)) |
| 1182 | ++start; |
| 1183 | /* blast trailing whitespace */ |
| 1184 | end = &start[strlen(start)]; |
| 1185 | while (--end >= start && apr_isspace(*end)) |
| 1186 | *end = '\0'; |
| 1187 | /* Zap leading whitespace by shifting */ |
| 1188 | if (start != buf) |
| 1189 | memmove(buf, start, end - start + 2); |
| 1190 | #ifdef DEBUG_CFG_LINES |
| 1191 | ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, APLOGNO(00555) "Read config: '%s'", buf); |
| 1192 | #endif |
| 1193 | return end - start + 1; |
| 1194 | } |
| 1195 | |
| 1196 | /* Read one line from open ap_configfile_t, strip LF, increase line number */ |
| 1197 | /* If custom handler does not define a getstr() function, read char by char */ |
no test coverage detected