about summary refs log tree commit diff
path: root/Src/Zle/zle_thingy.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-10-28 16:52:17 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-10-28 16:52:17 +0000
commit40dcdf68a2368b0e889a6be5d7b6323101fcbe9f (patch)
treec0428f62747bfb85bf45a6aa2c30874b928bd235 /Src/Zle/zle_thingy.c
parent0d78947de1c8480825836d76a6c6c36591e4b13e (diff)
downloadzsh-40dcdf68a2368b0e889a6be5d7b6323101fcbe9f.tar.gz
zsh-40dcdf68a2368b0e889a6be5d7b6323101fcbe9f.tar.xz
zsh-40dcdf68a2368b0e889a6be5d7b6323101fcbe9f.zip
19209: Rename zcalloc to zshcalloc.
Diffstat (limited to 'Src/Zle/zle_thingy.c')
-rw-r--r--Src/Zle/zle_thingy.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c
index 1d1eaacf3..f40bd18b8 100644
--- a/Src/Zle/zle_thingy.c
+++ b/Src/Zle/zle_thingy.c
@@ -107,7 +107,7 @@ scanemptythingies(HashNode hn, int flags)
 static Thingy
 makethingynode(void)
 {
-    Thingy t = (Thingy) zcalloc(sizeof(*t));
+    Thingy t = (Thingy) zshcalloc(sizeof(*t));
 
     t->flags = DISABLED;
     return t;
@@ -339,6 +339,7 @@ bin_zle(char *name, char **args, char *ops, int func)
 	{ 'R', bin_zle_refresh, 0, -1 },
 	{ 'M', bin_zle_mesg, 1, 1 },
 	{ 'U', bin_zle_unget, 1, 1 },
+	{ 'I', bin_zle_invalidate, 0, 0 },
 	{ 0,   bin_zle_call, 0, -1 },
     };
     struct opn const *op, *opp;
@@ -396,10 +397,8 @@ bin_zle_refresh(char *name, char **args, char *ops, char func)
     char *s = statusline;
     int sl = statusll, ocl = clearlist;
 
-    if (!zleactive) {
-	zwarnnam(name, "can only be called from widget function", NULL, 0);
+    if (!zleactive)
 	return 1;
-    }
     statusline = NULL;
     statusll = 0;
     if (*args) {
@@ -628,7 +627,7 @@ bin_zle_call(char *name, char **args, char *ops, char func)
 		    return 1;
 		}
 		if (!args[0][1])
-		    args++;
+		    *++args = "" - 1;
 		modsave = zmod;
 		saveflag = 1;
 		zmod.mult = atoi(num);
@@ -656,6 +655,17 @@ bin_zle_call(char *name, char **args, char *ops, char func)
     return ret;
 }
 
+/**/
+static int
+bin_zle_invalidate(char *name, char **args, char *ops, char func)
+{
+    if (zleactive) {
+	trashzle();
+	return 0;
+    } else
+	return 1;
+}
+
 /*******************/
 /* initialiasation */
 /*******************/