diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-09-10 13:45:15 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-09-10 13:45:15 +0200 |
commit | 291f00a6aa1c519ab1a36e9279ee486c4e6a95f3 (patch) | |
tree | 6b397ab1c666370de439b9c93df042d535b2711a | |
parent | 02d75b311c18bb7aaea966e0548c77912436ba92 (diff) | |
download | netifd-291f00a6aa1c519ab1a36e9279ee486c4e6a95f3.tar.gz |
remove script prefix
-rw-r--r-- | proto-shell.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/proto-shell.c b/proto-shell.c index 2b68c35..031d28a 100644 --- a/proto-shell.c +++ b/proto-shell.c @@ -20,7 +20,6 @@ struct proto_shell_handler { struct proto_handler proto; }; -#define DUMP_PREFIX "./" #define DUMP_SUFFIX " dump" static void proto_shell_add_handler(const char *script, struct json_object *obj) @@ -40,8 +39,8 @@ static void proto_shell_add_script(const char *name) FILE *f; int buflen, len; - cmd = alloca(strlen(name) + 1 + sizeof(DUMP_PREFIX) + sizeof(DUMP_SUFFIX)); - sprintf(cmd, DUMP_PREFIX "%s" DUMP_SUFFIX, name); + cmd = alloca(strlen(name) + 1 + sizeof(DUMP_SUFFIX)); + sprintf(cmd, "%s" DUMP_SUFFIX, name); f = popen(cmd, "r"); if (!f) @@ -104,7 +103,7 @@ void __init proto_shell_init(void) if (proto_fd < 0) goto close_cur; - glob("*.sh", 0, NULL, &g); + glob("./*.sh", 0, NULL, &g); for (i = 0; i < g.gl_pathc; i++) proto_shell_add_script(g.gl_pathv[i]); |