/[pcre]/code/tags/pcre-7.7/pcredemo.c
ViewVC logotype

Diff of /code/tags/pcre-7.7/pcredemo.c

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

revision 75 by nigel, Sat Feb 24 21:40:37 2007 UTC revision 97 by ph10, Mon Mar 5 12:36:47 2007 UTC
# Line 16  systems (e.g. Solaris) use the -R option Line 16  systems (e.g. Solaris) use the -R option
16  */  */
17    
18    
19    #ifdef HAVE_CONFIG_H
20    #  include <config.h>
21    #endif
22    
23  #include <stdio.h>  #include <stdio.h>
24  #include <string.h>  #include <string.h>
25  #include <pcre.h>  #include <pcre.h>
# Line 117  if (rc < 0) Line 121  if (rc < 0)
121      */      */
122      default: printf("Matching error %d\n", rc); break;      default: printf("Matching error %d\n", rc); break;
123      }      }
124    free(re);     /* Release memory used for the compiled pattern */    pcre_free(re);     /* Release memory used for the compiled pattern */
125    return 1;    return 1;
126    }    }
127    
# Line 223  if (namecount <= 0) printf("No named sub Line 227  if (namecount <= 0) printf("No named sub
227    
228  if (!find_all)  if (!find_all)
229    {    {
230    free(re);   /* Release the memory used for the compiled pattern */    pcre_free(re);   /* Release the memory used for the compiled pattern */
231    return 0;   /* Finish unless -g was given */    return 0;        /* Finish unless -g was given */
232    }    }
233    
234  /* Loop for second and subsequent matches */  /* Loop for second and subsequent matches */
# Line 276  for (;;) Line 280  for (;;)
280    if (rc < 0)    if (rc < 0)
281      {      {
282      printf("Matching error %d\n", rc);      printf("Matching error %d\n", rc);
283      free(re);    /* Release memory used for the compiled pattern */      pcre_free(re);    /* Release memory used for the compiled pattern */
284      return 1;      return 1;
285      }      }
286    
# Line 317  for (;;) Line 321  for (;;)
321    }      /* End of loop to find second and subsequent matches */    }      /* End of loop to find second and subsequent matches */
322    
323  printf("\n");  printf("\n");
324  free(re);       /* Release memory used for the compiled pattern */  pcre_free(re);       /* Release memory used for the compiled pattern */
325  return 0;  return 0;
326  }  }
327    

Legend:
Removed from v.75  
changed lines
  Added in v.97

  ViewVC Help
Powered by ViewVC 1.1.5