Re: [libdvdcss-devel] [PATCH] win32: Remove unnecessary PATH_MAX definition

Diego Biurrun <[email protected]>
Newsgroups gmane.comp.video.videolan.libdvdcss,gmane.comp.video.videolan.libdvdcss.devel
Message-ID <20141104095758.GQ30310@nibbler>
On Mon, Nov 03, 2014 at 11:39:43AM +0100, Diego Biurrun wrote:
> On Mon, Nov 03, 2014 at 11:23:12AM +0100, Diego Biurrun wrote:
> > On Mon, Nov 03, 2014 at 11:16:39AM +0100, Jean-Baptiste Kempf wrote:
> > > On 03 Nov, Diego Biurrun wrote :
> > > > On Mon, Nov 03, 2014 at 11:11:49AM +0100, Jean-Baptiste Kempf wrote:
> > > > > On 03 Nov, Diego Biurrun wrote :
> > > > > > PATH_MAX is present in all supported Windows platforms nowadays.
> > > > > 
> > > > > How is that windows version/platform specific, and not
> > > > > toolchain-related?
> > > > 
> > > > Good point; log message amended to:
> > > > 
> > > >   win32: Remove unnecessary PATH_MAX definition
> > > > 
> > > >   PATH_MAX is present in all supported Windows toolchains nowadays.
> > > 
> > > Well, in my setup, it does not work on a normal mingw.org of debian
> > > stable.
> > 
> > mingw32 or mingw64?
> 
> I cannot reproduce with package mingw32 at version 4.2.1.dfsg-2ubuntu1
> on my Ubuntu 14.04 system, neither with package gcc-mingw-w64-i686 at
> version 4.8.2-10ubuntu2+12.

I doubt you can reproduce it either the code is the following:

  #if defined(_WIN32_IE) && _WIN32_IE >= 0x500
    char psz_home[MAX_PATH];

    /* Cache our keys in
     * C:\Documents and Settings\$USER\Application Data\dvdcss\ */
    if (SHGetFolderPathA (NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE,
                          NULL, SHGFP_TYPE_CURRENT, psz_home ) == S_OK)
    {
        snprintf( dvdcss->psz_cachefile, PATH_MAX, "%s\\dvdcss", psz_home );
        dvdcss->psz_cachefile[PATH_MAX - 1] = '\0';
        psz_cache = dvdcss->psz_cachefile;
    }
  #else

Pay special attention to the use of both MAX_PATH and PATH_MAX in the same
block of code...

Diego
_______________________________________________
libdvdcss-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/libdvdcss-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.