Menu ▾ ▴

#221 parse_file substition feature should use g_regex_replace IMHO

open
nobody
None
5
2015-05-23
2015-05-23
Wolfgang
No

Just started using streamripper yesterday. Works pretty well, but I did not get the substitution feature of the -w option to work.
I have tried the streamripper 1.64.6-1 version that ships with debian wheezy. Then I applied
http://sourceforge.net/p/streamripper/code/ci/2f7c359d13a6985882ec65afaaf7637b52aceb2a/
to it. But that did not solve my problem.

Expected:

Using
s/(*UCP)[[:space:]]//
in parse_file replaces all spaces with
.

Observed:
only the first occurrence is replaced

Quick+Dirty-Code for parse.c, that worked for me:

if defined (USE_GLIB_REGEX)
gchar *tmp = g_regex_replace(rulep->reg, query_string, MAX_TRACK_LEN, 0, rulep->subst, 0, NULL);
mstrncpy (query_string, tmp, MAX_TRACK_LEN);
g_free (tmp);
else

Discussion


Log in to post a comment.