1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## warning_fix.dpatch by slava.semushin@gmail.com
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: http://code.google.com/p/mpdscribble/issues/detail?id=24
8
diff -ru mpdscribble-0.2.12.orig/as.c mpdscribble-0.2.12/as.c
9
--- mpdscribble-0.2.12.orig/as.c 2008-07-28 20:57:36 +0400
10
+++ mpdscribble-0.2.12/as.c 2008-07-30 14:39:22 +0400
20
return sleep (g_sleep);
21
diff -ru mpdscribble-0.2.12.orig/conn.c mpdscribble-0.2.12/conn.c
22
--- mpdscribble-0.2.12.orig/conn.c 2008-07-28 20:57:36 +0400
23
+++ mpdscribble-0.2.12/conn.c 2008-07-30 15:36:06 +0400
25
conn_mainloop_quit (void *data)
27
g_main_loop_quit (g.mainloop);
32
diff -ru mpdscribble-0.2.12.orig/file.c mpdscribble-0.2.12/file.c
33
--- mpdscribble-0.2.12.orig/file.c 2008-07-28 20:57:36 +0400
34
+++ mpdscribble-0.2.12/file.c 2008-07-30 15:44:49 +0400
36
char *mpd_host = getenv ("MPD_HOST");
37
char *mpd_port = getenv ("MPD_PORT");
38
char *http_proxy = getenv ("http_proxy");
43
file_config.verbose = -1;
44
diff -ru mpdscribble-0.2.12.orig/lmc.c mpdscribble-0.2.12/lmc.c
45
--- mpdscribble-0.2.12.orig/lmc.c 2008-07-28 20:57:36 +0400
46
+++ mpdscribble-0.2.12/lmc.c 2008-07-30 15:13:38 +0400
50
for (ch = g_mpd->errorStr; *ch; ++ch) {
51
- if (*ch=='\n' || *ch=='\t' || *ch=='\r' | *ch=='\v') {
52
+ if (*ch=='\n' || *ch=='\t' || *ch=='\r' || *ch=='\v') {
56
diff -ru mpdscribble-0.2.12.orig/mbid.c mpdscribble-0.2.12/mbid.c
57
--- mpdscribble-0.2.12.orig/mbid.c 2008-07-28 20:57:36 +0400
58
+++ mpdscribble-0.2.12/mbid.c 2008-07-30 15:46:25 +0400
63
-int mfile(int length, char ret[], FILE *fp, int *s) {
64
+void mfile(int length, char ret[], FILE *fp, int *s) {
65
int bytes = fread(ret,1,length,fp);
67
if (bytes != length) {
71
int bytes = fread (data, 1, OGG_MAX_CHUNK_SIZE, fp);
72
+ if (bytes != OGG_MAX_CHUNK_SIZE)
75
int marker_size = strlen (marker);
80
unsigned char header[4];
82
- fread (header, 1, 4, fp);
83
+ bytes = fread (header, 1, 4, fp);
87
size = header[3] | header[2]<<0x08 | header[1]<<0x10;
89
if ((header[0] & 0x7F) == 0x04)
92
mfile(2,version,fp,&s);
93
int version_major = (int)version[0];
94
- int version_minor = (int)version[1];
95
if (version_major == 2) {
96
debug("ID3v2.2.0 does not support MBIDs: %s\n",path);
99
if (version_major != 3 && version_major != 4) {
100
- debug("Unsupported ID3 version: v2.%d.%d\n",version_major,version_minor);
101
+ debug("Unsupported ID3 version: v2.%d.%d\n",version_major,(int)version[1]);
105
diff -ru mpdscribble-0.2.12.orig/mpdscribble.c mpdscribble-0.2.12/mpdscribble.c
106
--- mpdscribble-0.2.12.orig/mpdscribble.c 2008-07-28 20:57:36 +0400
107
+++ mpdscribble-0.2.12/mpdscribble.c 2008-07-30 15:59:40 +0400
116
@@ -149,11 +150,10 @@
120
- if (file_config.musicdir)
121
+ if (file_config.musicdir && chdir (file_config.musicdir) != 0)
123
// yeah, I know i'm being silly, but I can't be arsed to
124
// concat the parts :P
125
- chdir (file_config.musicdir);
126
if (getMBID (song.file, mbid))