Build failures with gcc 4.4
Commit Message
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
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
@@ -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);