From a1a34b8a472f7a99a8fe9a8696dea7b8d9215ae5 Mon Sep 17 00:00:00 2001 From: Dann Luciano Date: Fri, 29 Nov 2013 19:33:05 -0200 Subject: [PATCH] Added open support in OS X. --- queries.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/queries.c b/queries.c index 85cec4a..f57666b 100644 --- a/queries.c +++ b/queries.c @@ -48,6 +48,12 @@ #define sha1 SHA1 +#ifdef __APPLE__ +#define OPEN_BIN "open %s" +#else +#define OPEN_BIN "xdg-open %s" +#endif + char *get_downloads_directory (void); int verbosity; extern int offline_mode; @@ -1777,7 +1783,7 @@ void end_load (struct download *D) { logprintf ("Done: %s\n", D->name); } else if (D->next == 2) { static char buf[1000]; - sprintf (buf, "xdg-open %s", D->name); + sprintf (buf, OPEN_BIN, D->name); int x = system (buf); if (x < 0) { logprintf ("Can not open image viewer: %m\n");