From 6b183e6ba1553000b0ba5fab5477a3b7e8283bc9 Mon Sep 17 00:00:00 2001 From: waker Date: Tue, 10 Apr 2012 20:21:42 +0200 Subject: converter: fixed // bug; fixed potential bug in finding largest common path without reducing it to the last separator --- plugins/converter/converter.c | 2 +- plugins/converter/convgui.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/converter/converter.c b/plugins/converter/converter.c index e32c38a6..ee25dede 100644 --- a/plugins/converter/converter.c +++ b/plugins/converter/converter.c @@ -686,7 +686,7 @@ get_output_path (DB_playItem_t *it, const char *outfolder_user, const char *outf char subpath[e-s+1]; memcpy (subpath, s, e-s); subpath[e-s] = 0; - snprintf (outfolder_preserve, sizeof (outfolder_preserve), "%s/%s", outfolder_user[0] ? outfolder_user : getenv("HOME"), subpath); + snprintf (outfolder_preserve, sizeof (outfolder_preserve), "%s%s", outfolder_user[0] ? outfolder_user : getenv("HOME"), subpath); } } diff --git a/plugins/converter/convgui.c b/plugins/converter/convgui.c index d229c811..ad7fa4c4 100644 --- a/plugins/converter/convgui.c +++ b/plugins/converter/convgui.c @@ -144,6 +144,10 @@ converter_worker (void *ctx) { char *r = root; while (*path && *r) { if (*path != *r) { + // find new separator + while (r > root && *r != '/') { + r--; + } *r = 0; rootlen = r-root; break; @@ -153,7 +157,7 @@ converter_worker (void *ctx) { } } } -// fprintf (stderr, "common root path: %s\n", root); + fprintf (stderr, "common root path: %s\n", root); } for (int n = 0; n < conv->convert_items_count; n++) { -- cgit v1.2.3 From 3959c7f25b86e0e57a1a1258dfab120bcebaa1d8 Mon Sep 17 00:00:00 2001 From: waker Date: Wed, 11 Apr 2012 18:02:56 +0200 Subject: shellexec compile fix --- plugins/shellexec/shellexec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/shellexec/shellexec.c b/plugins/shellexec/shellexec.c index b73299f9..c3cc4251 100644 --- a/plugins/shellexec/shellexec.c +++ b/plugins/shellexec/shellexec.c @@ -49,7 +49,7 @@ #include #include -#include +#include "../../deadbeef.h" #include "shellexec.h" //#define trace(...) { fprintf(stderr, __VA_ARGS__); } -- cgit v1.2.3 From a2000931eac3a940e347f99a36793e2b6d636b5f Mon Sep 17 00:00:00 2001 From: waker Date: Wed, 11 Apr 2012 18:22:15 +0200 Subject: another shellexec compile fix --- plugins/shellexec/shellexec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/shellexec/shellexec.h b/plugins/shellexec/shellexec.h index 08fc2279..748340bd 100644 --- a/plugins/shellexec/shellexec.h +++ b/plugins/shellexec/shellexec.h @@ -21,7 +21,7 @@ #ifndef __SHELLEXEC_H #define __SHELLEXEC_H -#include +#include "../../deadbeef.h" //Probably it's reasonable to move these flags to parent struct enum { -- cgit v1.2.3