From: Hartmut Goebel Date: Sat, 2 Mar 2019 16:27:36 +0000 (+0100) Subject: gnunet-qr: Actually run gnunet-uri. X-Git-Tag: v0.11.1~8^2~1^2~12 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e729040833049ada5bb642e1084b603ec428742d;p=oweals%2Fgnunet.git gnunet-qr: Actually run gnunet-uri. --- diff --git a/src/util/gnunet-qr.c b/src/util/gnunet-qr.c index b375d20a7..c8919dae4 100644 --- a/src/util/gnunet-qr.c +++ b/src/util/gnunet-qr.c @@ -22,6 +22,7 @@ #include #include #include +#include "gnunet-qr-utils.h" static const char *usage_note = "gnunet-qr\n" @@ -128,16 +129,16 @@ int main (int argc, char **argv) LOG("Found %s \"%s\"\n", zbar_get_symbol_name(zbar_symbol_get_type(symbol)), data); - /* TODO - args = ["gnunet-uri", - // FIXME: "-c", configuration, - data]; - if (verbose = true) { - // TODO: print arguments: - printf("Running `%s %s %s %s`", *args, "", ""); // FIXME variable num args + if (configuration == NULL) { + char* command_args[] = {"gnunet-uri", data, NULL }; + LOG("Running `gnunet-uri %s`\n", data); + rc = fork_and_exec("gnunet-uri", command_args); + } else { + char* command_args[] = {"gnunet-uri", "-c", configuration, data, NULL }; + LOG("Running `gnunet-uri -c '%s' %s`\n", configuration, data); + rc = fork_and_exec("gnunet-uri", command_args); }; - rc = popen("gnunet-uri", *args); - */ + if (rc != 0) { printf("Failed to add URI %s\n", data); } else {