-/* $Header: arg.c,v 1.0 87/12/18 13:04:33 root Exp $
+/* $Header: arg.c,v 1.0.1.5 88/01/30 08:53:16 root Exp $
*
* $Log: arg.c,v $
+ * Revision 1.0.1.5 88/01/30 08:53:16 root
+ * patch9: fixed some missing right parens introduced (?) by patch 2
+ *
+ * Revision 1.0.1.4 88/01/28 10:22:06 root
+ * patch8: added eval operator.
+ *
+ * Revision 1.0.1.2 88/01/24 03:52:34 root
+ * patch 2: added STATBLKS dependencies.
+ *
+ * Revision 1.0.1.1 88/01/21 21:27:10 root
+ * Now defines signal return values correctly using VOIDSIG.
+ *
* Revision 1.0 87/12/18 13:04:33 root
* Initial revision
*
apush(ary,str_nmake((double)statbuf.st_atime));
apush(ary,str_nmake((double)statbuf.st_mtime));
apush(ary,str_nmake((double)statbuf.st_ctime));
+#ifdef STATBLOCKS
apush(ary,str_nmake((double)statbuf.st_blksize));
apush(ary,str_nmake((double)statbuf.st_blocks));
+#else
+ apush(ary,str_make(""));
+ apush(ary,str_make(""));
+#endif
}
sarg = (STR**)safemalloc((max+2)*sizeof(STR*));
sarg[0] = Nullstr;
register char *t;
bool dolong;
char ch;
+ static STR *sargnull = &str_no;
str_set(str,"");
len--; /* don't count pattern string */
sarg++;
- for (s = str_get(*(sarg++)); *sarg && *s && len; len--) {
+ for (s = str_get(*(sarg++)); *s; len--) {
+ if (len <= 0 || !*sarg) {
+ sarg = &sargnull;
+ len = 0;
+ }
dolong = FALSE;
for (t = s; *t && *t != '%'; t++) ;
if (!*t)
opargs[O_UNSHIFT] = A(1,0,0);
opargs[O_LINK] = A(1,1,0);
opargs[O_REPEAT] = A(1,1,0);
+ opargs[O_EVAL] = A(1,0,0);
}
+#ifdef VOIDSIG
+static void (*ihand)();
+static void (*qhand)();
+#else
static int (*ihand)();
static int (*qhand)();
+#endif
STR *
eval(arg,retary)
}
value = (double)(ary->ary_fill + 1);
break;
+ case O_EVAL:
+ str_sset(str,
+ do_eval(arg[1].arg_type != A_NULL ? sarg[1] : defstab->stab_val) );
+ STABSET(str);
+ break;
}
#ifdef DEBUGGING
dlevel--;