ok?

Index: c_ksh.c
===================================================================
RCS file: /d/cvs/src/bin/ksh/c_ksh.c,v
retrieving revision 1.50
diff -u -p -r1.50 c_ksh.c
--- c_ksh.c     21 Mar 2016 13:35:00 -0000      1.50
+++ c_ksh.c     2 Sep 2017 22:18:50 -0000
@@ -99,7 +99,7 @@ c_cd(char **wp)
                return 1;
        }
 
-       Xinit(xs, xp, PATH, ATEMP);
+       Xinit(xs, xp, PATH_MAX, ATEMP);
        /* xp will have a bogus value after make_path() - set it to 0
         * so that if it's used, it will cause a dump
         */
Index: path.c
===================================================================
RCS file: /d/cvs/src/bin/ksh/path.c,v
retrieving revision 1.18
diff -u -p -r1.18 path.c
--- path.c      14 Dec 2015 13:59:42 -0000      1.18
+++ path.c      2 Sep 2017 22:18:50 -0000
@@ -220,7 +220,7 @@ do_phys_path(XString *xsp, char *xp, con
        const char *p, *q;
        int len, llen;
        int savepos;
-       char lbuf[PATH];
+       char lbuf[PATH_MAX];
 
        Xcheck(*xsp, xp);
        for (p = path; p; p = q) {
Index: sh.h
===================================================================
RCS file: /d/cvs/src/bin/ksh/sh.h,v
retrieving revision 1.63
diff -u -p -r1.63 sh.h
--- sh.h        30 Aug 2017 17:08:45 -0000      1.63
+++ sh.h        2 Sep 2017 22:18:50 -0000
@@ -10,6 +10,7 @@
 
 /* Start of common headers */
 
+#include <limits.h>
 #include <setjmp.h>
 #include <stdarg.h>
 #include <signal.h>
@@ -33,7 +34,6 @@
 #define ISMAGIC(c)     ((unsigned char)(c) == MAGIC)
 
 #define        LINE    4096            /* input line size */
-#define        PATH    1024            /* pathname size (todo: 
PATH_MAX/pathconf()) */
 
 extern const char *kshname;    /* $0 */
 extern pid_t   kshpid;         /* $$, shell pid */


-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to