MCPcopy Create free account
hub / github.com/apache/httpd / cfg_trim_line

Function cfg_trim_line

server/util.c:1174–1194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1172}
1173
1174static 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 */

Callers 2

ap_cfg_getlineFunction · 0.85
ap_varbuf_cfg_getlineFunction · 0.85

Calls 1

ap_log_errorFunction · 0.50

Tested by

no test coverage detected