Module Name:    src
Committed By:   christos
Date:           Tue Mar 26 16:39:50 UTC 2019

Modified Files:
        src/usr.bin/m4: expr.c

Log Message:
print the source line and file where the error happened.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/m4/expr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/m4/expr.c
diff -u src/usr.bin/m4/expr.c:1.19 src/usr.bin/m4/expr.c:1.20
--- src/usr.bin/m4/expr.c:1.19	Mon Oct 26 17:11:28 2009
+++ src/usr.bin/m4/expr.c	Tue Mar 26 12:39:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: expr.c,v 1.19 2009/10/26 21:11:28 christos Exp $	*/
+/*	$NetBSD: expr.c,v 1.20 2019/03/26 16:39:50 christos Exp $	*/
 /* $OpenBSD: expr.c,v 1.17 2006/01/20 23:10:19 espie Exp $ */
 /*
  * Copyright (c) 2004 Marc Espie <es...@cvs.openbsd.org>
@@ -19,7 +19,7 @@
 #include "nbtool_config.h"
 #endif
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: expr.c,v 1.19 2009/10/26 21:11:28 christos Exp $");
+__RCSID("$NetBSD: expr.c,v 1.20 2019/03/26 16:39:50 christos Exp $");
 #include <stdint.h>
 #include <stdio.h>
 #include <stddef.h>
@@ -36,7 +36,8 @@ extern int yyerror(const char *);
 int
 yyerror(const char *msg)
 {
-	fprintf(stderr, "m4: %s in expr %s\n", msg, copy_toeval);
+	fprintf(stderr, "m4:%s:%zu: %s in expr %s\n", infile[ilevel].name,
+	    infile[ilevel].lineno, msg, copy_toeval);
 	return(0);
 }
 

Reply via email to