summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Anvin <hpa@tazenda.sc.orionmulti.com>2005-10-13 10:41:10 -0700
committerPeter Anvin <hpa@tazenda.sc.orionmulti.com>2005-10-13 10:41:10 -0700
commit8a2f69609767fd71d9f88367e6088c07e8ff3b66 (patch)
treeb4185d8d4807c31dd3f63f1d006c10b9c4a5b7fd
parentcbf26dca811026d69d775d0953da2645044a0d8c (diff)
downloadtftp-hpa-8a2f69609767fd71d9f88367e6088c07e8ff3b66.tar.gz
Handle transformations with matches
-rw-r--r--tftpd/remap.c5
1 files 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;