/[pcre]/code/trunk/pcregrep.c
ViewVC logotype

Diff of /code/trunk/pcregrep.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 529 by ph10, Fri May 21 16:43:17 2010 UTC revision 530 by ph10, Tue Jun 1 13:42:06 2010 UTC
# Line 909  match_patterns(char *matchptr, size_t le Line 909  match_patterns(char *matchptr, size_t le
909  int i;  int i;
910  for (i = 0; i < pattern_count; i++)  for (i = 0; i < pattern_count; i++)
911    {    {
912    *mrc = pcre_exec(pattern_list[i], hints_list[i], matchptr, length, 0,    *mrc = pcre_exec(pattern_list[i], hints_list[i], matchptr, (int)length, 0,
913      PCRE_NOTEMPTY, offsets, OFFSET_SIZE);      PCRE_NOTEMPTY, offsets, OFFSET_SIZE);
914    if (*mrc >= 0) return TRUE;    if (*mrc >= 0) return TRUE;
915    if (*mrc == PCRE_ERROR_NOMATCH) continue;    if (*mrc == PCRE_ERROR_NOMATCH) continue;
# Line 1365  while (ptr < endptr) Line 1365  while (ptr < endptr)
1365    offset to the current line is maintained in filepos. */    offset to the current line is maintained in filepos. */
1366    
1367    ptr += linelength + endlinelength;    ptr += linelength + endlinelength;
1368    filepos += linelength + endlinelength;    filepos += (int)(linelength + endlinelength);
1369    linenumber++;    linenumber++;
1370    
1371    /* If input is line buffered, and the buffer is not yet full, read another    /* If input is line buffered, and the buffer is not yet full, read another
# Line 1531  if ((sep = isdirectory(pathname)) != 0) Line 1531  if ((sep = isdirectory(pathname)) != 0)
1531        {        {
1532        int frc, nflen;        int frc, nflen;
1533        sprintf(buffer, "%.512s%c%.128s", pathname, sep, nextfile);        sprintf(buffer, "%.512s%c%.128s", pathname, sep, nextfile);
1534        nflen = strlen(nextfile);        nflen = (int)(strlen(nextfile));
1535    
1536        if (isdirectory(buffer))        if (isdirectory(buffer))
1537          {          {
# Line 1575  skipping was not requested. The scan pro Line 1575  skipping was not requested. The scan pro
1575  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
1576  the file name, or the filename was forced (-H). */  the file name, or the filename was forced (-H). */
1577    
1578  pathlen = strlen(pathname);  pathlen = (int)(strlen(pathname));
1579    
1580  /* 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. */
1581    
# Line 2028  for (i = 1; i < argc; i++) Line 2028  for (i = 1; i < argc; i++)
2028            }            }
2029          else                 /* Special case xxx=data */          else                 /* Special case xxx=data */
2030            {            {
2031            int oplen = equals - op->long_name;            int oplen = (int)(equals - op->long_name);
2032            int arglen = (argequals == NULL)? (int)strlen(arg) : argequals - arg;            int arglen = (argequals == NULL)?
2033                (int)strlen(arg) : (int)(argequals - arg);
2034            if (oplen == arglen && strncmp(arg, op->long_name, oplen) == 0)            if (oplen == arglen && strncmp(arg, op->long_name, oplen) == 0)
2035              {              {
2036              option_data = arg + arglen;              option_data = arg + arglen;
# Line 2050  for (i = 1; i < argc; i++) Line 2051  for (i = 1; i < argc; i++)
2051          char buff1[24];          char buff1[24];
2052          char buff2[24];          char buff2[24];
2053    
2054          int baselen = opbra - op->long_name;          int baselen = (int)(opbra - op->long_name);
2055          int fulllen = strchr(op->long_name, ')') - op->long_name + 1;          int fulllen = (int)(strchr(op->long_name, ')') - op->long_name + 1);
2056          int arglen = (argequals == NULL || equals == NULL)?          int arglen = (argequals == NULL || equals == NULL)?
2057            (int)strlen(arg) : argequals - arg;            (int)strlen(arg) : (int)(argequals - arg);
2058    
2059          sprintf(buff1, "%.*s", baselen, op->long_name);          sprintf(buff1, "%.*s", baselen, op->long_name);
2060          sprintf(buff2, "%s%.*s", buff1, fulllen - baselen - 2, opbra + 1);          sprintf(buff2, "%s%.*s", buff1, fulllen - baselen - 2, opbra + 1);
# Line 2205  for (i = 1; i < argc; i++) Line 2206  for (i = 1; i < argc; i++)
2206          {          {
2207          char *equals = strchr(op->long_name, '=');          char *equals = strchr(op->long_name, '=');
2208          int nlen = (equals == NULL)? (int)strlen(op->long_name) :          int nlen = (equals == NULL)? (int)strlen(op->long_name) :
2209            equals - op->long_name;            (int)(equals - op->long_name);
2210          fprintf(stderr, "pcregrep: Malformed number \"%s\" after --%.*s\n",          fprintf(stderr, "pcregrep: Malformed number \"%s\" after --%.*s\n",
2211            option_data, nlen, op->long_name);            option_data, nlen, op->long_name);
2212          }          }

Legend:
Removed from v.529  
changed lines
  Added in v.530

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12