tar: fix too eager autodetection, closes 11531
function old new delta is_suffixed_with - 54 +54 tar_main 1006 1026 +20 open_transformer 92 79 -13 config_file_action 478 458 -20 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/2 up/down: 74/-33) Total: 41 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@@ -245,7 +245,7 @@ static int FAST_FUNC config_file_action(const char *filename,
|
||||
parser_t *p;
|
||||
struct module_entry *m;
|
||||
int rc = TRUE;
|
||||
const char *base, *ext;
|
||||
const char *base;
|
||||
|
||||
/* Skip files that begin with a "." */
|
||||
base = bb_basename(filename);
|
||||
@@ -266,8 +266,7 @@ static int FAST_FUNC config_file_action(const char *filename,
|
||||
* "include FILE_NOT_ENDING_IN_CONF" must work too.
|
||||
*/
|
||||
if (depth != 0) {
|
||||
ext = strrchr(base, '.');
|
||||
if (ext == NULL || strcmp(ext + 1, "conf"))
|
||||
if (!is_suffixed_with(base, ".conf"))
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user