diff options
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -347,7 +347,7 @@ parse_args(argv, what, setargsp) int what; /* OF_CMDLINE or OF_SET */ int *setargsp; { - static char cmd_opts[NELEM(goptions) + 3]; /* o:\0 */ + static char cmd_opts[NELEM(goptions) + 5]; /* o:w:\0 */ static char set_opts[NELEM(goptions) + 5]; /* Ao;s\0 */ char *opts; char *array = (char *) 0; @@ -359,7 +359,7 @@ parse_args(argv, what, setargsp) char *p, *q; /* see cmd_opts[] declaration */ - strlcpy(cmd_opts, "o:", sizeof cmd_opts); + strlcpy(cmd_opts, "o:w:", sizeof cmd_opts); p = cmd_opts + strlen(cmd_opts); /* see set_opts[] declaration */ strlcpy(set_opts, "A:o;s", sizeof set_opts); @@ -423,6 +423,14 @@ parse_args(argv, what, setargsp) } break; + case 'w': + writefd = open(go.optarg, O_WRONLY); + if (writefd == -1) { + bi_errorf("could not open %s", go.optarg); + return -1; + } + break; + case '?': return -1; |