summaryrefslogtreecommitdiff
path: root/gfx/fig.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-03 13:36:39 -0300
committerWerner Almesberger <werner@almesberger.net>2016-09-03 19:18:29 -0300
commit91c6bc93281cd79d69d13caa9aa4f7f0df262044 (patch)
tree82d87631357e6572ac4602b108a704b458f2c097 /gfx/fig.c
parentc8b5418ada13b5e30a524b7f87d50865bef27f30 (diff)
downloadeeshow-91c6bc93281cd79d69d13caa9aa4f7f0df262044.tar.gz
eeshow-91c6bc93281cd79d69d13caa9aa4f7f0df262044.tar.bz2
eeshow-91c6bc93281cd79d69d13caa9aa4f7f0df262044.zip
gfx/: ignore foo: prefix in output file names
Note sure if this is the best place for it. We could also tweak argv in the respective main.
Diffstat (limited to 'gfx/fig.c')
-rw-r--r--gfx/fig.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gfx/fig.c b/gfx/fig.c
index 8ae7721..a60e41b 100644
--- a/gfx/fig.c
+++ b/gfx/fig.c
@@ -297,6 +297,7 @@ static bool fig_args(void *ctx, int argc, char *const *argv)
const char *template = NULL;
const char **vars = NULL;
int n_vars = 0;
+ const char *colon;
char c;
FILE *file;
int lines_to_colors = 8;
@@ -304,7 +305,8 @@ static bool fig_args(void *ctx, int argc, char *const *argv)
while ((c = getopt(argc, argv, "o:t:D:")) != EOF)
switch (c) {
case 'o':
- output = optarg;
+ colon = strchr(optarg, ':');
+ output = colon ? colon + 1 : optarg;
break;
case 't':
template = optarg;