summaryrefslogtreecommitdiffstats
path: root/smenu.c
diff options
context:
space:
mode:
authorpgen <p.gen.progs@gmail.com>2018-03-26 22:26:44 +0200
committerpgen <p.gen.progs@gmail.com>2018-03-26 22:26:44 +0200
commit5d594e550cb8e1f8128fae8b15c7c7bd39c0a72e (patch)
treed3cd728d1a9f976134087728232cbb3c7ceccb42 /smenu.c
parentbcbeda4ca16f11a6d8284d5500d982b5027a2613 (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.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/smenu.c b/smenu.c
index 471b31e..f694736 100644
--- a/smenu.c
+++ b/smenu.c
@@ -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);