diff options
author | pgen <p.gen.progs@gmail.com> | 2018-03-26 22:26:44 +0200 |
---|---|---|
committer | pgen <p.gen.progs@gmail.com> | 2018-03-26 22:26:44 +0200 |
commit | 5d594e550cb8e1f8128fae8b15c7c7bd39c0a72e (patch) | |
tree | d3cd728d1a9f976134087728232cbb3c7ceccb42 /smenu.c | |
parent | bcbeda4ca16f11a6d8284d5500d982b5027a2613 (diff) |
Make the argument of -N and -U optional
The regex: . (match everything) is used when the argument is not present.
Diffstat (limited to 'smenu.c')
-rw-r--r-- | smenu.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -5909,7 +5909,7 @@ main(int argc, char * argv[]) /* """"""""""""""""""""""""""""" */ while ((opt = egetopt(argc, argv, "Vf:h?X:x:qdMba:i:e:S:I:E:A:Z:1:2:3:4:5:C:R:" - "kclwrgn:t%m:s:W:L:T%P%pN:U:FD:")) + "kclwrgn:t%m:s:W:L:T%P%pN%U%FD:")) != -1) { switch (opt) @@ -6512,6 +6512,11 @@ main(int argc, char * argv[]) break; case 'N': + if (optarg == NULL) + optarg = "."; + else if (*optarg == '\0') + optarg = "."; + if (daccess_np == NULL) { daccess_np = concat("(", optarg, ")", NULL); @@ -6526,6 +6531,11 @@ main(int argc, char * argv[]) break; case 'U': + if (optarg == NULL) + optarg = "."; + else if (*optarg == '\0') + optarg = "."; + if (daccess_up == NULL) { daccess_up = concat("(", optarg, ")", NULL); |