From 8a2f69609767fd71d9f88367e6088c07e8ff3b66 Mon Sep 17 00:00:00 2001 From: Peter Anvin Date: Thu, 13 Oct 2005 10:41:10 -0700 Subject: [PATCH] Handle transformations with matches --- tftpd/remap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tftpd/remap.c b/tftpd/remap.c index 3fa0fc0..dda5632 100644 --- a/tftpd/remap.c +++ b/tftpd/remap.c @@ -90,8 +90,9 @@ static int genmatchstring(char *string, const char *pattern, const char *input, mlen = pmatch[n].rm_eo - pmatch[n].rm_so; len += mlen; if ( string ) { - memcpy(string, input+pmatch[n].rm_so, mlen); - string += mlen; + const char *p = input+pmatch[n].rm_so; + while ( mlen-- ) + *string++ = xform(*p++); } } break;