summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/arith_yacc.c2
-rw-r--r--src/options.c5
-rw-r--r--src/var.c4
-rw-r--r--src/var.h2
4 files changed, 6 insertions, 7 deletions
diff --git a/src/arith_yacc.c b/src/arith_yacc.c
index ad653ed..e473594 100644
--- a/src/arith_yacc.c
+++ b/src/arith_yacc.c
@@ -280,7 +280,7 @@ static intmax_t assignment(int var, int noeval)
 
 	return setvarint(val.name,
 			 op == ARITH_ASS ? result :
-			 do_binop(op - 11, lookupvarint(val.name), result));
+			 do_binop(op - 11, lookupvarint(val.name), result), 0);
 }
 
 intmax_t arith(const char *s)
diff --git a/src/options.c b/src/options.c
index 568148a..f669117 100644
--- a/src/options.c
+++ b/src/options.c
@@ -419,7 +419,7 @@ getopts(char *optstr, char *optvar, char **optfirst)
 	char *p, *q;
 	char c = '?';
 	int done = 0;
-	char s[12];
+	char s[2];
 	char **optnext;
 	int ind = shellparam.optind;
 	int off = shellparam.optoff;
@@ -487,8 +487,7 @@ atend:
 
 out:
 	ind = optnext - optfirst + 1;
-	fmtstr(s, sizeof(s), "%d", ind);
-	setvar("OPTIND", s, VNOFUNC);
+	setvarint("OPTIND", ind, VNOFUNC);
 	s[0] = c;
 	s[1] = '\0';
 	setvar(optvar, s, 0);
diff --git a/src/var.c b/src/var.c
index 17d3637..7f9af9c 100644
--- a/src/var.c
+++ b/src/var.c
@@ -207,13 +207,13 @@ setvar(const char *name, const char *val, int flags)
  * ored with the flags of the variable.
  */
 
-intmax_t setvarint(const char *name, intmax_t val)
+intmax_t setvarint(const char *name, intmax_t val, int flags)
 {
 	int len = max_int_length(sizeof(val));
 	char buf[len];
 
 	fmtstr(buf, len, "%jd", val);
-	setvar(name, buf, 0);
+	setvar(name, buf, flags);
 	return val;
 }
 
diff --git a/src/var.h b/src/var.h
index 66443df..e4e2cff 100644
--- a/src/var.h
+++ b/src/var.h
@@ -127,7 +127,7 @@ extern const char defpathvar[];
 
 void initvar(void);
 void setvar(const char *, const char *, int);
-intmax_t setvarint(const char *, intmax_t);
+intmax_t setvarint(const char *, intmax_t, int);
 void setvareq(char *, int);
 struct strlist;
 void listsetvar(struct strlist *, int);
c/commit/home/.config/cwm/cwmrc?id=bc9314aebda5e161c79da0309b555b8df80b2561&follow=1'>Add bindings for brightness controlJune McEnroe Weirdly the Fn key doesn't change how the F row registers... I wonder if I can do something about that. 2021-02-07Set X key repeat rateJune McEnroe 2021-02-07Bump font size to 12June McEnroe 11 is what I use on macOS, but I feel like my eyes are working harder here. 2021-02-07Fully configure and rebind cwmJune McEnroe This is sort of a mix of trying to emulate macOS somewhat for my muscle memory and just rebinding some of the cwm defaults to use 4- rather than M-. 2021-02-07Add BintiJune McEnroe 2021-02-07Finish configuring xtermJune McEnroe 2021-02-06Enable tapping, reverse scroll, set scaling in wsconsctlJune McEnroe 2021-02-06Set root window to black on purple snowJune McEnroe 2021-02-06Add xmodmap configurationJune McEnroe 2021-02-06Add initial OpenBSD X configurationJune McEnroe cwm still needs a lot more rebinding, and I need to actually look at its other options. xterm definitely still needs some configuration, but I at least managed to get it to use a decent looking font. Very happy that OpenBSD includes Luxi Mono, which is what my usual font, Go Mono, is based on anyway. Still missing is xmodmap and such. 2021-02-06Add xterm output to schemeJune McEnroe