Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- main.org.c 2011-10-13 22:27:20.000000000 +0700
- +++ main.c 2011-10-14 00:17:18.000000000 +0700
- @@ -33,6 +33,7 @@
- #include <curl/curl.h>
- #include <libgen.h>
- #include <sha2.h>
- +#include <glob.h>
- #include "compat.h"
- #include "miner.h"
- @@ -1701,14 +1702,23 @@
- {
- json_error_t err;
- json_t *config;
- -
- - config = json_load_file(arg, 0, &err);
- - if (!json_is_object(config))
- - return "JSON decode of file failed";
- -
- - /* Parse the config now, so we can override it. That can keep pointers
- - * so don't free config object. */
- - return parse_config(config);
- +
- + glob_t gfn;
- + glob(arg, GLOB_NOMAGIC|GLOB_TILDE, NULL, &gfn);
- + int n;
- + for(n = 0; n < gfn.gl_pathc; n++) {
- + config = json_load_file(gfn.gl_pathv[n], 0, &err);
- + if (!json_is_object(config))
- + return "JSON decode of file failed";
- +
- + /* Parse the config now, so we can override it. That can keep pointers
- + * so don't free config object. */
- + char *rtn = parse_config(config);
- + if(rtn != NULL)
- + return rtn;
- + }
- + globfree(&gfn);
- + return NULL;
- }
- #ifdef HAVE_OPENCL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement