twarn about \w no arg - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit d0648192ab892f41213db3a3d92b0619de995e3d
(DIR) parent 14b4a4702c719bf185dde797999a0ba5cad5465f
(HTM) Author: rsc <devnull@localhost>
Date: Sat, 21 Apr 2007 22:37:13 +0000
warn about \w no arg
Diffstat:
M src/cmd/htmlroff/t11.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/src/cmd/htmlroff/t11.c b/src/cmd/htmlroff/t11.c
t@@ -72,8 +72,13 @@ e_w(void)
{
Rune *a;
Rune buf[40];
-
+ static Rune zero;
+
a = getqarg();
+ if(a == nil){
+ warn("no arg for \\w");
+ a = &zero;
+ }
runesnprint(buf, sizeof buf, "%ld", runestrlen(a));
pushinputstring(buf);
nr(L("st"), 0);