-const char pcrs_rcs[] = "$Id: pcrs.c,v 1.16 2001/11/30 21:32:14 jongfoster Exp $";
+const char pcrs_rcs[] = "$Id: pcrs.c,v 1.17 2002/03/08 13:45:48 oes Exp $";
/*********************************************************************
*
*
* Revisions :
* $Log: pcrs.c,v $
+ * Revision 1.17 2002/03/08 13:45:48 oes
+ * Hiding internal functions
+ *
* Revision 1.16 2001/11/30 21:32:14 jongfoster
* Fixing signed/unsigned comparison (Andreas please check this!)
* One tab->space
*********************************************************************/
static pcrs_substitute *pcrs_compile_replacement(const char *replacement, int trivialflag, int capturecount, int *errptr)
{
- int length, i, k, l, quoted;
+ int i, k, l, quoted;
+ size_t length;
char *text;
pcrs_substitute *r;
*********************************************************************/
pcrs_job *pcrs_compile_command(const char *command, int *errptr)
{
- int i, k, l, limit, quoted = FALSE;
+ int i, k, l, quoted = FALSE;
+ size_t limit;
char delimiter;
char *tokens[4];
pcrs_job *newjob;
offset,
i, k,
matches_found,
- newsize,
submatches,
max_matches = PCRS_MAX_MATCH_INIT;
+ size_t newsize;
pcrs_match *matches, *dummy;
char *result_offset;
* Find the pattern and calculate the space
* requirements for the result
*/
- newsize=subject_length;
+ newsize = subject_length;
- while ((submatches = pcre_exec(job->pattern, job->hints, subject, subject_length, offset, 0, offsets, 3 * PCRS_MAX_SUBMATCHES)) > 0)
+ while ((submatches = pcre_exec(job->pattern, job->hints, subject, (int) subject_length, offset, 0, offsets, 3 * PCRS_MAX_SUBMATCHES)) > 0)
{
job->flags |= PCRS_SUCCESS;
matches[i].submatches = submatches;
for (i=0; i < matches_found; i++)
{
/* copy the chunk preceding the match */
- memcpy(result_offset, subject + offset, matches[i].submatch_offset[0] - offset);
+ memcpy(result_offset, subject + offset, (size_t) matches[i].submatch_offset[0] - offset);
result_offset += matches[i].submatch_offset[0] - offset;
/* For every segment of the substitute.. */