git: 9front

Download patch

ref: 2cff0bb9dbd47d6b48e5420d18900218d0237177
parent: 3d3439a70c9033920587f9871c6a20379850dda4
author: qwx <qwx@sciops.net>
date: Tue Oct 21 16:48:42 EDT 2025

awk: remove obsolete -V and -m flags

both have been removed in onetrueawk as well, with -V
renamed as -version/--version.  for -m, the buffers
are already dynamically grown.

--- a/sys/man/1/awk
+++ b/sys/man/1/awk
@@ -11,14 +11,6 @@
 .B -d
 ]
 [
-.BI -mf
-.I n
-]
-[
-.B -mr
-.I n
-]
-[
 .B -safe
 ]
 [
@@ -87,14 +79,6 @@
 If
 .BR FS
 is null, the input line is split into one field per character.
-.PP
-To compensate for inadequate implementation of storage management,
-the 
-.B -mr
-option can be used to set the maximum size of the input record,
-and the
-.B -mf
-option to set the maximum number of fields.
 .PP
 The
 .B -safe
--- a/sys/src/cmd/awk/main.c
+++ b/sys/src/cmd/awk/main.c
@@ -22,8 +22,6 @@
 THIS SOFTWARE.
 ****************************************************************/
 
-char	*version = "version 19990602";
-
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
@@ -52,8 +50,7 @@
 
 void main(int argc, char *argv[])
 {
-	char *fs = nil, *marg;
-	int temp;
+	char *fs = nil;
 
 	setfcr(getfcr() & ~FPINVAL);
 
@@ -109,30 +106,10 @@
 			if (argv[1][2] == '\0' && --argc > 1 && isclvar((++argv)[1]))
 				setclvar(argv[1]);
 			break;
-		case 'm':	/* more memory: -mr=record, -mf=fields */
-				/* no longer needed */
-			marg = argv[1];
-			if (argv[1][3])
-				temp = atoi(&argv[1][3]);
-			else {
-				argv++; argc--;
-				temp = atoi(&argv[1][0]);
-			}
-			switch (marg[2]) {
-			case 'r':	recsize = temp; break;
-			case 'f':	nfields = temp; break;
-			default: FATAL("unknown option %s\n", marg);
-			}
-			break;
 		case 'd':
 			dbg = atoi(&argv[1][2]);
 			if (dbg == 0)
 				dbg = 1;
-			print("awk %s\n", version);
-			break;
-		case 'V':	/* added for exptools "standard" */
-			print("awk %s\n", version);
-			exits(0);
 			break;
 		default:
 			WARNING("unknown option %s ignored", argv[1]);
--