~ubuntu-branches/ubuntu/jaunty/mpdscribble/jaunty

« back to all changes in this revision

Viewing changes to debian/patches/warnings-fix.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Michal Čihař
  • Date: 2008-09-22 15:16:12 UTC
  • Revision ID: james.westby@ubuntu.com-20080922151612-m8yhggpg0eqfej1n
Tags: 0.2.12-13
* Add README.source.
* Update to standards 3.8.0.
* Integrate some patches from upstream BTS:
  - Switch to libsoup-2.4.
  - Fix crash, when Ctrl+C is pressed.
  - Fix typo in help.
  - Fix memory corruption in some cases.
  - Fix some compilation warnings and code errors.
* Switch to debhelper 7.
* Add debug package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## warning_fix.dpatch by slava.semushin@gmail.com 
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: http://code.google.com/p/mpdscribble/issues/detail?id=24
 
6
 
 
7
@DPATCH@
 
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
 
11
@@ -729,7 +729,9 @@
 
12
 unsigned int
 
13
 as_sleep (void)
 
14
 {
 
15
+  /*
 
16
   long end;
 
17
+  */
 
18
 
 
19
   if (!conn_pending ())
 
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
 
24
@@ -92,6 +92,7 @@
 
25
 conn_mainloop_quit (void *data)
 
26
 {
 
27
   g_main_loop_quit (g.mainloop);
 
28
+  return 0;
 
29
 }
 
30
 
 
31
 int
 
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
 
35
@@ -321,7 +321,7 @@
 
36
   char *mpd_host = getenv ("MPD_HOST");
 
37
   char *mpd_port = getenv ("MPD_PORT");
 
38
   char *http_proxy = getenv ("http_proxy");
 
39
-  char *data;
 
40
+  char *data = NULL;
 
41
   int i;
 
42
 
 
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
 
47
@@ -39,7 +39,7 @@
 
48
 {
 
49
   char *ch;
 
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') {
 
53
       *ch = ' ';
 
54
     }
 
55
   }
 
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
 
59
@@ -72,7 +72,7 @@
 
60
     return size;
 
61
 }
 
62
 
 
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);
 
66
     
 
67
     if (bytes != length) {
 
68
@@ -151,6 +151,9 @@
 
69
     }
 
70
 
 
71
   int bytes = fread (data, 1, OGG_MAX_CHUNK_SIZE, fp);
 
72
+  if (bytes != OGG_MAX_CHUNK_SIZE)
 
73
+    goto ogg_failed;
 
74
+
 
75
   int marker_size = strlen (marker);
 
76
 
 
77
   int offset = -1;
 
78
@@ -203,7 +206,10 @@
 
79
   int bytes;
 
80
   unsigned char header[4];
 
81
   
 
82
-  fread (header, 1, 4, fp);
 
83
+  bytes = fread (header, 1, 4, fp);
 
84
+  if (bytes != 4)
 
85
+    return -1;
 
86
+
 
87
   size = header[3] | header[2]<<0x08 | header[1]<<0x10;
 
88
 
 
89
   if ((header[0] & 0x7F) == 0x04)
 
90
@@ -311,13 +317,12 @@
 
91
 
 
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);
 
97
             break;
 
98
         }
 
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]);
 
102
             break;
 
103
         }
 
104
 
 
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
 
108
@@ -23,6 +23,7 @@
 
109
 
 
110
 #include <stdlib.h>
 
111
 #include <stdio.h>
 
112
+#include <unistd.h>
 
113
 
 
114
 #include "file.h"
 
115
 #include "misc.h"
 
116
@@ -149,11 +150,10 @@
 
117
 
 
118
           submitted = 1;
 
119
 
 
120
-          if (file_config.musicdir)
 
121
+          if (file_config.musicdir && chdir (file_config.musicdir) != 0)
 
122
             {
 
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))
 
127
                 mbid[0] = 0x00;
 
128
               else