summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHartmut Goebel <h.goebel@crazy-compilers.com>2019-03-02 17:27:36 +0100
committerChristian Grothoff <christian@grothoff.org>2019-04-03 13:42:16 +0200
commite729040833049ada5bb642e1084b603ec428742d (patch)
tree169071eb7718c251c20dadd7296e1a451321621b /src
parent6f4f14aa56a879587ae731751d51ea062e3d0956 (diff)
gnunet-qr: Actually run gnunet-uri.
Diffstat (limited to 'src')
-rw-r--r--src/util/gnunet-qr.c19
1 files 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 <zbar.h>
#include <stdbool.h>
#include <getopt.h>
+#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 {