The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] compiling v9sh
@ 2020-02-11  7:46 arnold
  2020-02-11 10:03 ` Rob Pike
  0 siblings, 1 reply; 3+ messages in thread
From: arnold @ 2020-02-11  7:46 UTC (permalink / raw)
  To: tuhs

For anyone who's interested, here is what it took to compile Geoff
Collyer's v9sh on Ubuntu 18.04.

Arnold
----------------------------------
diff -ur v9sh/error.c v9sh-new/error.c
--- v9sh/error.c	2017-07-29 11:45:07.000000000 +0300
+++ v9sh-new/error.c	2020-02-10 17:31:33.275920947 +0200
@@ -24,7 +24,7 @@
 	}
 	if (per) {
 		prs(colon);
-		prs(errno < 0 || errno >= sys_nerr? "Bad errno": sys_errlist[errno]);
+		prs(strerror(errno));
 	}
 	newline();
 	exitsh(ERROR);
diff -ur v9sh/pathserv.c v9sh-new/pathserv.c
--- v9sh/pathserv.c	2017-07-29 12:06:25.000000000 +0300
+++ v9sh-new/pathserv.c	2020-02-10 17:29:43.666971083 +0200
@@ -30,7 +30,7 @@
 {
 	struct stat buf;
 
-	if (stat(name, &buf) == 0 && (buf.st_mode&S_IFMT) == S_IFREG &&
+	if (stat(name, &buf) == 0 && S_ISREG(buf.st_mode) &&
 	    access(name, EXECUTE) == 0)
 		return 0;
 	else
diff -ur v9sh/xec.c v9sh-new/xec.c
--- v9sh/xec.c	2017-07-29 12:27:02.000000000 +0300
+++ v9sh-new/xec.c	2020-02-10 17:29:50.607030967 +0200
@@ -612,7 +612,7 @@
 
 			if (flags&ttyflg && (dir1 = spname(tempdir, &score)) &&
 			    stat(dir1, &sb) == 0 &&
-			    (sb.st_mode&S_IFMT) == S_IFDIR &&
+			    S_ISDIR(sb.st_mode) &&
 			    access(dir1, EXECUTE) == 0) {
 				/* dir1 is a searchable directory. */
 				if (score < bestscore) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-11 10:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11  7:46 [TUHS] compiling v9sh arnold
2020-02-11 10:03 ` Rob Pike
2020-02-11 10:09   ` arnold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).