aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandy Palamar <palamar@ualberta.ca>2023-05-30 09:39:02 -0600
committerRandy Palamar <palamar@ualberta.ca>2023-06-22 09:09:46 -0600
commitd897956f922220972c6fd4bdc218b31647d4a4ec (patch)
tree7348e3250b752a72c97513b9bfb6b23794421d21
parent9c0251e644fab2fd728f2708629a72907cfcce57 (diff)
downloadvis-d897956f922220972c6fd4bdc218b31647d4a4ec.tar.gz
vis-d897956f922220972c6fd4bdc218b31647d4a4ec.tar.xz
allow underscore (_) in command names
fixes #971
-rw-r--r--sam.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sam.c b/sam.c
index 181f229..d088e9c 100644
--- a/sam.c
+++ b/sam.c
@@ -655,7 +655,7 @@ static void parse_argv(const char **s, const char *argv[], size_t maxarg) {
static bool valid_cmdname(const char *s) {
unsigned char c = (unsigned char)*s;
- return c && !isspace(c) && !isdigit(c) && (!ispunct(c) || (c == '-' && valid_cmdname(s+1)));
+ return c && !isspace(c) && !isdigit(c) && (!ispunct(c) || c == '_' || (c == '-' && valid_cmdname(s+1)));
}
static char *parse_cmdname(const char **s) {