diff options
author | Greg McGary <greg@mcgary.org> | 1999-04-09 01:28:03 +0000 |
---|---|---|
committer | Greg McGary <greg@mcgary.org> | 1999-04-09 01:28:03 +0000 |
commit | 1040ccd7271a97125c941834f337acade7bb42b1 (patch) | |
tree | de9f4b51f6ec3e716a8f7782997315062c6b3445 | |
parent | 7e5fe8e2b0b4e55ec5760ec04fb8b4cd6ba7b7aa (diff) | |
download | idutils-1040ccd7271a97125c941834f337acade7bb42b1.tar.gz idutils-1040ccd7271a97125c941834f337acade7bb42b1.tar.bz2 idutils-1040ccd7271a97125c941834f337acade7bb42b1.zip |
* libidu/idread.c (maybe_read_id_file): Add `b' for binary
to fopen mode string. [From tbisp@uswest.net]
* src/lid.c (report_grep): Change name of gid_FILE to source_FILE.
-rw-r--r-- | libidu/idread.c | 4 | ||||
-rw-r--r-- | src/lid.c | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/libidu/idread.c b/libidu/idread.c index c725f9f..b327a6a 100644 --- a/libidu/idread.c +++ b/libidu/idread.c @@ -1,5 +1,5 @@ /* idread.c -- functions to read ID database files - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc. Written by Greg McGary <gkm@gnu.ai.mit.edu> This program is free software; you can redistribute it and/or modify @@ -55,7 +55,7 @@ struct file_link ** maybe_read_id_file (char const *id_file_name, struct idhead *idhp) { obstack_init (&idhp->idh_file_link_obstack); - idhp->idh_FILE = fopen (id_file_name, "r"); + idhp->idh_FILE = fopen (id_file_name, "rb"); if (idhp->idh_FILE == 0) return 0; @@ -555,17 +555,17 @@ report_grep (char const *name, struct file_link **flinkv) while (*flinkv) { int line_number = 0; - FILE *gid_FILE; + FILE *source_FILE; maybe_relative_file_name (file_name, *flinkv++, cw_dlink); - gid_FILE = fopen (file_name, "r"); - if (gid_FILE == 0) + source_FILE = fopen (file_name, "r"); + if (source_FILE == 0) { error (0, errno, "can't open `%s'", file_name); continue; } - while (fgets (line + 1, sizeof (line) - 1, gid_FILE)) + while (fgets (line + 1, sizeof (line) - 1, source_FILE)) { line_number++; if (pattern) @@ -579,7 +579,7 @@ report_grep (char const *name, struct file_link **flinkv) else if (word_match (name, line)) printf ("%s:%d:%s", file_name, line_number, line + 1); } - fclose (gid_FILE); + fclose (source_FILE); } } |