sh: use _PATH_DEFPATH instead of hand-rolling the default path
authorSimon Schubert <corecode@dragonflybsd.org>
Thu, 5 Feb 2009 09:33:55 +0000 (10:33 +0100)
committerSimon Schubert <corecode@dragonflybsd.org>
Thu, 5 Feb 2009 09:56:58 +0000 (10:56 +0100)
bin/sh/var.c

index aab9da0..8bac874 100644 (file)
@@ -46,6 +46,7 @@
  */
 
 #include <locale.h>
+#include <paths.h>
 
 #include "shell.h"
 #include "output.h"
@@ -102,7 +103,12 @@ STATIC const struct varinit varinit[] = {
          NULL },
        { &vmpath,      VSTRFIXED|VTEXTFIXED|VUNSET,    "MAILPATH=",
          NULL },
-       { &vpath,       VSTRFIXED|VTEXTFIXED,           "PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/pkg/bin:/usr/pkg/sbin",
+       { &vpath,       VSTRFIXED|VTEXTFIXED,
+#ifdef _PATH_DEFPATH
+               "PATH=" _PATH_DEFPATH,
+#else
+               "PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/pkg/bin:/usr/pkg/sbin",
+#endif
          changepath },
        { &vppid,       VSTRFIXED|VTEXTFIXED|VUNSET,    "PPID=",
          NULL },