summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2004-01-19 16:12:05 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2004-01-19 16:12:05 +0000
commitc585ffdfe1209a05296db7b67184b267c81d9321 (patch)
tree7c6a12fa06803e01278cc5e8bc0b1072431c556e
parent8f42c813a0defdb15100ea4e5113186d80390544 (diff)
Use off_t for file sizes, and don't forget to print a ':' when using
the -b option. ok millert@
-rw-r--r--usr.bin/grep/grep.h4
-rw-r--r--usr.bin/grep/util.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/grep/grep.h b/usr.bin/grep/grep.h
index 8163bf0627c..1d886d57c20 100644
--- a/usr.bin/grep/grep.h
+++ b/usr.bin/grep/grep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: grep.h,v 1.8 2003/07/02 21:04:10 deraadt Exp $ */
+/* $OpenBSD: grep.h,v 1.9 2004/01/19 16:12:04 otto Exp $ */
/*-
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -43,7 +43,7 @@
typedef struct {
size_t len;
int line_no;
- int off;
+ off_t off;
char *file;
char *dat;
} str_t;
diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c
index a5ee22c9127..341d787ce44 100644
--- a/usr.bin/grep/util.c
+++ b/usr.bin/grep/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.20 2004/01/18 19:01:55 espie Exp $ */
+/* $OpenBSD: util.c,v 1.21 2004/01/19 16:12:04 otto Exp $ */
/*-
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -517,7 +517,8 @@ printline(str_t *line, int sep)
if (bflag) {
if (n)
putchar(sep);
- printf("%lu", (unsigned long)line->off);
+ printf("%lld", (long long)line->off);
+ ++n;
}
if (n)
putchar(sep);