summaryrefslogtreecommitdiff
path: root/usr.bin/awk/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/awk/main.c')
-rw-r--r--usr.bin/awk/main.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/awk/main.c b/usr.bin/awk/main.c
index 3ec64332ff5..481e98b078a 100644
--- a/usr.bin/awk/main.c
+++ b/usr.bin/awk/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.67 2023/11/28 20:54:38 millert Exp $ */
+/* $OpenBSD: main.c,v 1.68 2024/01/25 16:40:51 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -23,7 +23,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
-const char *version = "version 20231127";
+const char *version = "version 20240122";
#define DEBUG
#include <stdio.h>
@@ -180,8 +180,6 @@ int main(int argc, char *argv[])
}
if (strcmp(argv[1], "--csv") == 0) { /* turn on csv input processing */
CSV = true;
- if (fs)
- WARNING("danger: don't set FS when --csv is in effect");
argc--;
argv++;
continue;
@@ -203,8 +201,6 @@ int main(int argc, char *argv[])
break;
case 'F': /* set field separator */
fs = setfs(getarg(&argc, &argv, "no field separator"));
- if (CSV)
- WARNING("danger: don't set FS when --csv is in effect");
break;
case 'v': /* -v a=1 to be done NOW. one -v for each */
vn = getarg(&argc, &argv, "no variable name");
@@ -238,6 +234,9 @@ int main(int argc, char *argv[])
}
}
+ if (CSV && (fs != NULL || lookup("FS", symtab) != NULL))
+ WARNING("danger: don't set FS when --csv is in effect");
+
/* argv[1] is now the first argument */
if (npfile == 0) { /* no -f; first argument is program */
if (argc <= 1) {