Project

General

Profile

vdr-muggle-0.2.3-gcc44.patch

Patch - Heffer, 03/31/2009 03:55 PM

Download (2.03 KB)

View differences:

muggle-0.2.3/mg_db.c 2009-03-31 15:18:32.133400460 +0200
1140 1140
	if (genre1.empty()) {
1141 1141
		genre1 = m_TCON.toCString(the_setup.utf8);
1142 1142
		const char *tcon=genre1.c_str();
1143
		char *rparen=strchr(tcon,')');
1143
		char *rparen=strchr(strdup(tcon),')');
1144 1144
		if (tcon[0]=='(' && rparen) {
1145 1145
			*rparen=0;
1146 1146
			genre1 = m_GenreIds[tcon+1];
muggle-0.2.3/mg_image_provider.c 2009-03-31 15:15:09.648153178 +0200
39 39
		return (FALSE);
40 40
	}
41 41
	else {
42
		char *ext = rindex( entry->d_name, '.' );
42
		char *dname = strdup(entry->d_name);
43
		char *ext = rindex( dname, '.' );
43 44

  
44 45
		if( ext ) {
45 46
			if( !strcmp( ext, ".jpg" ) || !strcmp( ext, ".png" ) || !strcmp( ext, ".JPG" ) || !strcmp( ext, ".PNG" ) ) {
muggle-0.2.3/mg_tools.c 2009-03-31 15:11:59.913150640 +0200
170 170

  
171 171
char *
172 172
extension(const char *filename) {
173
	char *dot = strrchr(filename,'.');
173
	char *fname = strdup(filename);
174
	char *dot = strrchr(fname,'.');
174 175
	if (!dot)
175
		dot = strrchr(filename,0)-1;
176
		dot = strrchr(fname,0)-1;
176 177
	return dot+1;
177 178
}
178 179

  
......
209 210
}
210 211

  
211 212
bool mkdir_p(const char *s) {
212
	char *slash=strrchr(s,'/');
213
	if (!slash) return false;
214 213
	char *sc = strdup(s);
214
	char *slash=strrchr(sc,'/');
215
	if (!slash) return false;
215 216
	*strrchr(sc,'/')=0;	// cut off the filename
216 217
	char *p = sc;
217 218
	int mode;
muggle-0.2.3/mg_tools.h 2009-03-31 14:57:30.649150865 +0200
14 14
#ifndef _MUGGLE_TOOLS_H
15 15
#define _MUGGLE_TOOLS_H
16 16

  
17
#include <cstdarg>
17 18
#include <iostream>
18 19
#include <sstream>
19 20
#include <string>