summaryrefslogtreecommitdiff
path: root/bin/ksh/var.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ksh/var.c')
-rw-r--r--bin/ksh/var.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/bin/ksh/var.c b/bin/ksh/var.c
index 989542aa044..688d9630b70 100644
--- a/bin/ksh/var.c
+++ b/bin/ksh/var.c
@@ -1,9 +1,9 @@
-/* $OpenBSD: var.c,v 1.17 2004/05/08 19:42:35 deraadt Exp $ */
+/* $OpenBSD: var.c,v 1.18 2004/12/18 20:55:52 millert Exp $ */
#include "sh.h"
-#include "ksh_time.h"
+#include <time.h>
#include "ksh_limval.h"
-#include "ksh_stat.h"
+#include <sys/stat.h>
#include <ctype.h>
/*
@@ -17,14 +17,14 @@
*/
static struct tbl vtemp;
static struct table specials;
-static char *formatstr ARGS((struct tbl *vp, const char *s));
-static void export ARGS((struct tbl *vp, const char *val));
-static int special ARGS((const char *name));
-static void unspecial ARGS((const char *name));
-static void getspec ARGS((struct tbl *vp));
-static void setspec ARGS((struct tbl *vp));
-static void unsetspec ARGS((struct tbl *vp));
-static struct tbl *arraysearch ARGS((struct tbl *, int));
+static char *formatstr(struct tbl *vp, const char *s);
+static void export(struct tbl *vp, const char *val);
+static int special(const char *name);
+static void unspecial(const char *name);
+static void getspec(struct tbl *vp);
+static void setspec(struct tbl *vp);
+static void unsetspec(struct tbl *vp);
+static struct tbl *arraysearch(struct tbl *, int);
/*
* create a new block for function calls and simple commands
@@ -664,8 +664,8 @@ typeset(var, set, clr, field, base)
*/
for (t = vpbase; t; t = t->u.array) {
int fake_assign;
- char UNINITIALIZED(*s);
- char UNINITIALIZED(*free_me);
+ char *s = NULL;
+ char *free_me = NULL;
fake_assign = (t->flag & ISSET) && (!val || t != vp)
&& ((set & (UCASEV_AL|LCASEV|LJUST|RJUST|ZEROFIL))
@@ -1013,7 +1013,7 @@ setspec(vp)
{
struct stat statb;
s = str_val(vp);
- if (ISABSPATH(s) && eaccess(s, W_OK|X_OK) == 0
+ if (s[0] == '/' && access(s, W_OK|X_OK) == 0
&& stat(s, &statb) == 0 && S_ISDIR(statb.st_mode))
tmpdir = str_save(s, APERM);
}