Files
pkgsrc-ng/editors/mg2a/patches/patch-ad
2013-09-26 17:14:40 +02:00

29 lines
791 B
Plaintext

$NetBSD: patch-ad,v 1.2 2000/07/10 18:26:54 tron Exp $
--- sys/bsd/fullpath.c.orig Wed May 31 16:36:31 2000
+++ sys/bsd/fullpath.c Wed May 31 16:36:31 2000
@@ -0,0 +1,23 @@
+/* test program by John P. Refling *
+#include <stdlib.h>
+#include <sys/param.h>
+#define begin {
+#define end }
+int main(argc, argv)
+int argc;
+char **argv;
+{char resolved_path[MAXPATHLEN];
+char trial_path[MAXPATHLEN];
+char path[MAXPATHLEN];
+char *envpath;
+if (realpath(argv[0], resolved_path) != NULL ) begin
+ printf("%s\n", resolved_path);
+end
+else if ( (envpath = getenv("PATH")) != NULL ) begin
+ printf("%s\n", envpath);
+ while (strchr(envpath, ':') != NULL) begin
+ printf("%d\n", envpath-strchr(envpath,':'));
+ envpath = strchr(envpath,':');
+ end
+end
+else printf("bad\n");}