depmod: fix syntax with modules in parameter

Patch by Tanguy Pruvot <tanguy.pruvot@gmail.com>
Change-Id: I21b8664db01cf0132db82f8d6caa1a0e77e71004
from https://github.com/tpruvot/android_external_busybox
Rebased for busybox 1.25.0 by Chris Renshaw <osm0sis@outlook.com>
This commit is contained in:
Chris Renshaw 2016-09-12 16:55:01 -03:00 committed by topjohnwu
parent 3b78ffa6a6
commit c48e14ccd0

View File

@ -49,7 +49,10 @@ static int FAST_FUNC parse_module(struct recursive_state *state,
image = xmalloc_open_zipped_read_close(fname, &len);
e = moddb_get_or_create(modules, bb_get_last_path_component_nostrip(fname));
e->name = xstrdup(fname + 2); /* skip "./" */
if (strncmp(fname, "./", 2) == 0)
e->name = xstrdup(fname + 2);
else
e->name = xstrdup(fname);
for (ptr = image; ptr < image + len - 10; ptr++) {
if (is_prefixed_with(ptr, "depends=")) {