twarn about \w no arg - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
commit d0648192ab892f41213db3a3d92b0619de995e3d
parent 14b4a4702c719bf185dde797999a0ba5cad5465f
Author: rsc 
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(-)
---
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);