#ifdef DEBUG
#define TRACE(param) trace param
+typedef union node unode;
static void trace (const char *, ...);
static void trargs (char **);
-static void showtree (union node *);
+static void showtree (unode *);
static void trputc (int);
static void trputs (const char *);
static void opentrace (void);
static int getoptscmd (int, char **);
#endif
-#ifndef CONFIG_TRUE_FALSE
+#ifndef CONFIG_TRUE
static int true_main (int, char **);
+#endif
+#ifndef CONFIG_FALSE
static int false_main (int, char **);
#endif
}
-#ifndef CONFIG_TRUE_FALSE
+#ifndef CONFIG_FALSE
static int
false_main(argc, argv)
int argc;
{
return 1;
}
+#endif
-
+#ifndef CONFIG_TRUE
static int
true_main(argc, argv)
int argc;
char **argv;
{
struct strlist *sp;
+ volatile struct shparam saveparam;
exitstatus = 0;
for (sp = cmdenviron; sp ; sp = sp->next)
setstackmark(&smark);
fullname = find_dot_file(argv[1]);
+
+ if (argc>2) {
+ saveparam = shellparam;
+ shellparam.malloc = 0;
+ shellparam.nparam = argc - 2;
+ shellparam.p = argv + 2;
+ };
+
setinputfile(fullname, 1);
commandname = fullname;
cmdloop(0);
popfile();
+
+ if (argc>2) {
+ freeparam(&shellparam);
+ shellparam = saveparam;
+ };
+
popstackmark(&smark);
}
return exitstatus;
static void
showtree(n)
- union node *n;
+ unode *n;
{
trputs("showtree called\n");
shtree(n, 1, NULL, stdout);
/*
* Copyright (c) 1999 Herbert Xu <herbert@debian.org>
* This file contains code for the times builtin.
- * $Id: ash.c,v 1.32 2001/10/28 05:12:18 andersen Exp $
+ * $Id: ash.c,v 1.33 2001/10/31 10:40:37 andersen Exp $
*/
static int timescmd (int argc, char **argv)
{