version 1.1.1.1, 2012/02/21 23:05:51
|
version 1.1.1.2, 2012/02/21 23:50:25
|
Line 6
|
Line 6
|
its pattern matching. On a Unix or Win32 system it can recurse into |
its pattern matching. On a Unix or Win32 system it can recurse into |
directories. |
directories. |
|
|
Copyright (c) 1997-2011 University of Cambridge | Copyright (c) 1997-2012 University of Cambridge |
|
|
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
Line 625 Arguments:
|
Line 625 Arguments:
|
Returns: the number of characters read, zero at end of file |
Returns: the number of characters read, zero at end of file |
*/ |
*/ |
|
|
static int | static unsigned int |
read_one_line(char *buffer, int length, FILE *f) |
read_one_line(char *buffer, int length, FILE *f) |
{ |
{ |
int c; |
int c; |
Line 1573 grep_or_recurse(char *pathname, BOOL dir_recurse, BOOL
|
Line 1573 grep_or_recurse(char *pathname, BOOL dir_recurse, BOOL
|
int rc = 1; |
int rc = 1; |
int sep; |
int sep; |
int frtype; |
int frtype; |
int pathlen; |
|
void *handle; |
void *handle; |
FILE *in = NULL; /* Ensure initialized */ |
FILE *in = NULL; /* Ensure initialized */ |
|
|
Line 1585 gzFile ingz = NULL;
|
Line 1584 gzFile ingz = NULL;
|
BZFILE *inbz2 = NULL; |
BZFILE *inbz2 = NULL; |
#endif |
#endif |
|
|
|
#if defined SUPPORT_LIBZ || defined SUPPORT_LIBZ2 |
|
int pathlen; |
|
#endif |
|
|
/* If the file name is "-" we scan stdin */ |
/* If the file name is "-" we scan stdin */ |
|
|
if (strcmp(pathname, "-") == 0) |
if (strcmp(pathname, "-") == 0) |
Line 1664 skipping was not requested. The scan proceeds. If this
|
Line 1667 skipping was not requested. The scan proceeds. If this
|
argument at top level, we don't show the file name, unless we are only showing |
argument at top level, we don't show the file name, unless we are only showing |
the file name, or the filename was forced (-H). */ |
the file name, or the filename was forced (-H). */ |
|
|
|
#if defined SUPPORT_LIBZ || defined SUPPORT_LIBZ2 |
pathlen = (int)(strlen(pathname)); |
pathlen = (int)(strlen(pathname)); |
|
#endif |
|
|
/* Open using zlib if it is supported and the file name ends with .gz. */ |
/* Open using zlib if it is supported and the file name ends with .gz. */ |
|
|