From e729040833049ada5bb642e1084b603ec428742d Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Sat, 2 Mar 2019 17:27:36 +0100 Subject: [PATCH] gnunet-qr: Actually run gnunet-uri. --- src/util/gnunet-qr.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) 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 { -- 2.25.1