/[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 1501 by ph10, Tue Jul 8 16:16:14 2014 UTC revision 1502 by ph10, Mon Sep 15 13:56:18 2014 UTC
# Line 471  if (strlen(s) > MAXPATLEN) Line 471  if (strlen(s) > MAXPATLEN)
471    {    {
472    fprintf(stderr, "pcregrep: pattern is too long (limit is %d bytes)\n",    fprintf(stderr, "pcregrep: pattern is too long (limit is %d bytes)\n",
473      MAXPATLEN);      MAXPATLEN);
474    free(p);    free(p);
475    return NULL;    return NULL;
476    }    }
477  p->next = NULL;  p->next = NULL;
# Line 2550  while (fgets(buffer, PATBUFSIZE, f) != N Line 2550  while (fgets(buffer, PATBUFSIZE, f) != N
2550    afterwards, as a precaution against any later code trying to use it. */    afterwards, as a precaution against any later code trying to use it. */
2551    
2552    *patlastptr = add_pattern(buffer, *patlastptr);    *patlastptr = add_pattern(buffer, *patlastptr);
2553    if (*patlastptr == NULL)    if (*patlastptr == NULL)
2554      {      {
2555      if (f != stdin) fclose(f);      if (f != stdin) fclose(f);
2556      return FALSE;      return FALSE;
2557      }      }
2558    if (*patptr == NULL) *patptr = *patlastptr;    if (*patptr == NULL) *patptr = *patlastptr;
2559    
2560    /* This loop is needed because compiling a "pattern" when -F is set may add    /* This loop is needed because compiling a "pattern" when -F is set may add
# Line 2566  while (fgets(buffer, PATBUFSIZE, f) != N Line 2566  while (fgets(buffer, PATBUFSIZE, f) != N
2566      {      {
2567      if (!compile_pattern(*patlastptr, pcre_options, popts, TRUE, filename,      if (!compile_pattern(*patlastptr, pcre_options, popts, TRUE, filename,
2568          linenumber))          linenumber))
2569        {        {
2570        if (f != stdin) fclose(f);        if (f != stdin) fclose(f);
2571        return FALSE;        return FALSE;
2572        }        }
2573      (*patlastptr)->string = NULL;            /* Insurance */      (*patlastptr)->string = NULL;            /* Insurance */
2574      if ((*patlastptr)->next == NULL) break;      if ((*patlastptr)->next == NULL) break;
2575      *patlastptr = (*patlastptr)->next;      *patlastptr = (*patlastptr)->next;

Legend:
Removed from v.1501  
changed lines
  Added in v.1502

  ViewVC Help
Powered by ViewVC 1.1.5