diff options
author | Matti Lehtimäki <matti.lehtimaki@gmail.com> | 2012-09-17 19:21:38 +0300 |
---|---|---|
committer | Matti Lehtimäki <matti.lehtimaki@gmail.com> | 2012-09-17 19:21:38 +0300 |
commit | 792857f38c02ad2f8c7be52803f00f03304d564e (patch) | |
tree | 86332084a5c014a9378b6a52bd458bccad42bb33 | |
parent | 823ced0e58385c959dc9de8a4621004f6e2d5ce0 (diff) | |
download | vdr-plugin-epgfixer-792857f38c02ad2f8c7be52803f00f03304d564e.tar.gz vdr-plugin-epgfixer-792857f38c02ad2f8c7be52803f00f03304d564e.tar.bz2 |
Fix replacing with empty string at the beginning of a string when using s///.
-rw-r--r-- | regexp.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -129,6 +129,8 @@ void cRegexp::ParseRegexp(char *restring) regexp = strdup(&restring[2]); if (*(p+1) != '/') // replacement = strdup(p+1); + else + replacement = strdup(""); break; } } @@ -232,7 +234,7 @@ bool cRegexp::Apply(cEvent *Event) start_offset = ovector[1]; } // replace EPG field if regexp matched - if (**resultstring && (last_match_end < tmpstringlen-1)) { + if (last_match_end > 0 && (last_match_end < tmpstringlen-1)) { resultstring = cString::sprintf("%s%s", *resultstring, tmpstring+last_match_end); switch (source) { case REGEXP_TITLE: |