aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/main.c b/main.c
index 8c8fb40..58f1541 100644
--- a/main.c
+++ b/main.c
@@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
-const char *version = "version 20231127";
+const char *version = "version 20231228";
#define DEBUG
#include <stdio.h>
@@ -157,8 +157,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;
@@ -180,8 +178,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");
@@ -203,6 +199,10 @@ int main(int argc, char *argv[])
argc--;
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) {