updated on Thu Jan 19 16:10:29 UTC 2012
[aur-mirror.git] / vdr / vdr-1.6.0-const.diff
blobbddcdcc3858f1f7a99b7a5c80a66ceb5c94a2ca4
1 Source: http://download.opensuse.org/repositories/vdr/openSUSE_11.1/src/vdr-1.6.0-62.1.src.rpm
2 Index: vdr-1.6.0/recording.c
3 ===================================================================
4 --- vdr-1.6.0.orig/recording.c
5 +++ vdr-1.6.0/recording.c
6 @@ -509,8 +509,8 @@ cRecording::cRecording(cTimer *Timer, co
7 Utf8Strn0Cpy(SubtitleBuffer, Subtitle, MAX_SUBTITLE_LENGTH);
8 Subtitle = SubtitleBuffer;
10 - char *macroTITLE = strstr(Timer->File(), TIMERMACRO_TITLE);
11 - char *macroEPISODE = strstr(Timer->File(), TIMERMACRO_EPISODE);
12 + const char *macroTITLE = strstr(Timer->File(), TIMERMACRO_TITLE);
13 + const char *macroEPISODE = strstr(Timer->File(), TIMERMACRO_EPISODE);
14 if (macroTITLE || macroEPISODE) {
15 name = strdup(Timer->File());
16 name = strreplace(name, TIMERMACRO_TITLE, Title);
17 @@ -551,7 +551,7 @@ cRecording::cRecording(const char *FileN
18 sortBuffer = NULL;
19 fileName = strdup(FileName);
20 FileName += strlen(VideoDirectory) + 1;
21 - char *p = strrchr(FileName, '/');
22 + const char *p = strrchr(FileName, '/');
24 name = NULL;
25 info = new cRecordingInfo;
26 @@ -1022,7 +1022,8 @@ void cRecordings::DelByName(const char *
27 if (recording) {
28 cThreadLock DeletedRecordingsLock(&DeletedRecordings);
29 Del(recording, false);
30 - char *ext = strrchr(recording->FileName(), '.');
31 + // wtf?
32 + char *ext = strrchr(const_cast<char*>(recording->FileName()), '.');
33 if (ext) {
34 strncpy(ext, DELEXT, strlen(ext));
35 recording->fileSizeMB = DirSizeMB(recording->FileName());
36 Index: vdr-1.6.0/svdrp.c
37 ===================================================================
38 --- vdr-1.6.0.orig/svdrp.c
39 +++ vdr-1.6.0/svdrp.c
40 @@ -736,7 +736,7 @@ void cSVDRP::CmdGRAB(const char *Option)
41 char *strtok_next;
42 FileName = strtok_r(p, delim, &strtok_next);
43 // image type:
44 - char *Extension = strrchr(FileName, '.');
45 + const char *Extension = strrchr(FileName, '.');
46 if (Extension) {
47 if (strcasecmp(Extension, ".jpg") == 0 || strcasecmp(Extension, ".jpeg") == 0)
48 Jpeg = true;
49 @@ -795,16 +795,17 @@ void cSVDRP::CmdGRAB(const char *Option)
50 char RealFileName[PATH_MAX];
51 if (FileName) {
52 if (grabImageDir) {
53 - cString s;
54 - char *slash = strrchr(FileName, '/');
55 + cString s(FileName);
56 + FileName = s;
57 + const char *slash = strrchr(FileName, '/');
58 if (!slash) {
59 s = AddDirectory(grabImageDir, FileName);
60 FileName = s;
62 slash = strrchr(FileName, '/'); // there definitely is one
63 - *slash = 0;
64 - char *r = realpath(FileName, RealFileName);
65 - *slash = '/';
66 + cString t(s);
67 + t.Truncate(slash - FileName);
68 + char *r = realpath(t, RealFileName);
69 if (!r) {
70 LOG_ERROR_STR(FileName);
71 Reply(501, "Invalid file name \"%s\"", FileName);