Build failures with gcc 4.4

Message ID 4A2A7886.80801@cadsoft.de
State New
Headers

Commit Message

Klaus Schmidinger June 6, 2009, 2:09 p.m. UTC
  On 04.06.2009 09:12, Ludwig Nussel wrote:
> ...
> So gcc 4.4 finally hit openSUSE as well. I use the attached patch to
> make vdr compile. Seems to work fine too. The code that requires
> those const casts is really ugly though.

How about the attached change?
Should apply to VDR 1.6 just as well.

Klaus
  

Comments

Ludwig Nussel June 8, 2009, 11:48 a.m. UTC | #1
Klaus Schmidinger wrote:
> On 04.06.2009 09:12, Ludwig Nussel wrote:
> > ...
> > So gcc 4.4 finally hit openSUSE as well. I use the attached patch to
> > make vdr compile. Seems to work fine too. The code that requires
> > those const casts is really ugly though.
> 
> How about the attached change?
> Should apply to VDR 1.6 just as well.

Looks better indeed. I've added it to the vdr package in the build
service now.

cu
Ludwig
  

Patch

--- svdrp.c	2009/06/06 13:42:52	2.4
+++ svdrp.c	2009/06/06 14:03:55
@@ -798,16 +798,17 @@ 
      char RealFileName[PATH_MAX];
      if (FileName) {
         if (grabImageDir) {
-           cString s;
-           char *slash = strrchr(FileName, '/');
+           cString s(FileName);
+           FileName = s;
+           const char *slash = strrchr(FileName, '/');
            if (!slash) {
               s = AddDirectory(grabImageDir, FileName);
               FileName = s;
               }
            slash = strrchr(FileName, '/'); // there definitely is one
-           *slash = 0;
-           char *r = realpath(FileName, RealFileName);
-           *slash = '/';
+           cString t(s);
+           t.Truncate(slash - FileName);
+           char *r = realpath(t, RealFileName);
            if (!r) {
               LOG_ERROR_STR(FileName);
               Reply(501, "Invalid file name \"%s\"", FileName);