| 1376 | } |
| 1377 | |
| 1378 | static int do_config_from_file(config_fn_t fn, |
| 1379 | const enum config_origin_type origin_type, |
| 1380 | const char *name, FILE *f, void *data, |
| 1381 | enum config_scope scope, |
| 1382 | const struct config_options *opts) |
| 1383 | { |
| 1384 | struct config_source top = CONFIG_SOURCE_INIT; |
| 1385 | int ret; |
| 1386 | |
| 1387 | if (origin_type == CONFIG_ORIGIN_FILE && (!name || !*name)) |
| 1388 | BUG("missing filename for CONFIG_ORIGIN_FILE"); |
| 1389 | |
| 1390 | top.u.file = f; |
| 1391 | top.origin_type = origin_type; |
| 1392 | top.name = name; |
| 1393 | top.default_error_action = CONFIG_ERROR_DIE; |
| 1394 | top.do_fgetc = config_file_fgetc; |
| 1395 | top.do_ungetc = config_file_ungetc; |
| 1396 | top.do_ftell = config_file_ftell; |
| 1397 | |
| 1398 | flockfile(f); |
| 1399 | ret = do_config_from(&top, fn, data, scope, opts); |
| 1400 | funlockfile(f); |
| 1401 | return ret; |
| 1402 | } |
| 1403 | |
| 1404 | static int git_config_from_stdin(config_fn_t fn, void *data, |
| 1405 | enum config_scope scope) |
no test coverage detected