summaryrefslogtreecommitdiff
path: root/plugins/converter
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-09-07 21:14:32 +0200
committerGravatar waker <wakeroid@gmail.com>2012-09-07 21:14:32 +0200
commit75864c320ae5e0c036688230b5053883c0bcaa33 (patch)
tree00abaee113083cde9701460b8c595e4c179ec1e6 /plugins/converter
parent716afd8d2d3a48a3bef3a22a89f7b911b55aea4c (diff)
converter: replace / with \ in filename parts, using the new title formatting feature
Diffstat (limited to 'plugins/converter')
-rw-r--r--plugins/converter/converter.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/plugins/converter/converter.c b/plugins/converter/converter.c
index 4da5f327..2d7e8230 100644
--- a/plugins/converter/converter.c
+++ b/plugins/converter/converter.c
@@ -667,7 +667,9 @@ get_output_field (DB_playItem_t *it, const char *field, char *out, int sz)
{
int idx = deadbeef->pl_get_idx_of (it);
char temp[PATH_MAX];
- deadbeef->pl_format_title (it, idx, temp, sizeof (temp), -1, field);
+ char fmt[strlen(field)+3];
+ snprintf (fmt, sizeof (fmt), "%%/%s", field);
+ deadbeef->pl_format_title (it, idx, temp, sizeof (temp), -1, fmt);
// escape special chars
char invalid[] = "$\"`\\";
@@ -681,12 +683,6 @@ get_output_field (DB_playItem_t *it, const char *field, char *out, int sz)
*p++ = *t;
n--;
}
- else if (*t == '/') {
- *p++ = '\\';
- n--;
- *p++ = '\\';
- n--;
- }
else {
*p++ = *t;
n--;