From 80c95820ccacfe458dbc21d05737df209a77fa1f Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Thu, 17 Jan 2019 20:46:44 -0500 Subject: [PATCH] fixed fetch rules for finding files in Code directory --- config.h | 4 ++-- src/fetch.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config.h b/config.h index d8033da..22fcbc8 100644 --- a/config.h +++ b/config.h @@ -120,8 +120,8 @@ static Rule* BuiltinRules[] = { (Rule[]){ /* Look up .c or .h files in Code/ */ { MATCHES, "data", "\\.[ch]$" }, { ISDIR, "Code", NULL }, - { EXEC, "[[ $(find Code -type f -name '*$data') ]]", NULL }, - { LAUNCH, "find Code -type f -name '*$data' | xargs -r edit", NULL }, + { EXEC, "[[ \"$(find Code -type f -name \"*$data\")\" ]]", NULL }, + { LAUNCH, "find Code -type f -name \"*$data\" | xargs -r edit", NULL }, { COMPLETE, NULL, NULL } }, (Rule[]){ /* If it's an existing directory, open it with system default */ diff --git a/src/fetch.c b/src/fetch.c index 4a21868..fbb1f2f 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -212,8 +212,10 @@ int main(int argc, char** argv) { for (; rule->type != COMPLETE; rule++) { if (debug) printf(" %s '%s' '%s'\n", type2str(rule->type), rule->arg1, rule->arg2); - if (!apply_rule(rule)) + if (!apply_rule(rule)) { + printf(" FAIL\n"); break; + } } if (rule->type == COMPLETE) exit(0); -- 2.49.0