Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-20 Thread Erik de Castro Lopo
Janne Hyvärinen wrote: > Seems safe indeed. > Attached an updated patch where metaflac works too. Janne, thanks for your hard work on this. Unfortunately this patch fails to apply for me. The problem is that all the Visual Studio files have CRLF newlines, while all the C files have just LF and t

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-19 Thread JonY
On 3/20/2013 00:35, Janne Hyvärinen wrote: >> >> As for calling __wgetmainargs, I have some concerns about the security >> implications: >> LoadLibrary("msvcrt.dll") <- Which msvcrt? Theoretical security exploit. > > There is msvcrt.dll in the System32 dir in all supported Windows > systems. That

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-19 Thread LRN
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 19.03.2013 20:35, Janne Hyvärinen wrote: > > On 19.3.2013 15:49, JonY wrote: >> On 3/19/2013 19:59, Janne Hyvärinen wrote: >>> On 18.3.2013 12:25, Erik de Castro Lopo wrote: JonY wrote: > Before anyone does anything, see __wgetmainar

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-19 Thread Janne Hyvärinen
On 19.3.2013 15:49, JonY wrote: > On 3/19/2013 19:59, Janne Hyvärinen wrote: >> On 18.3.2013 12:25, Erik de Castro Lopo wrote: >>> JonY wrote: >>> Before anyone does anything, see __wgetmainargs . It can expand wildcards. S

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-19 Thread JonY
On 3/19/2013 19:59, Janne Hyvärinen wrote: > On 18.3.2013 12:25, Erik de Castro Lopo wrote: >> JonY wrote: >> >>> Before anyone does anything, see __wgetmainargs >>> . >>> >>> It can expand wildcards. Since it already provides argc/argv/env, it

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-18 Thread Janne Hyvärinen
On 18.3.2013 15:17, JonY wrote: > On 3/18/2013 19:34, LRN wrote: >> On 18.03.2013 13:35, JonY wrote: >>> Before anyone does anything, see __wgetmainargs >>> . >>> It can expand wildcards. Since it already provides argc/argv/env, >>> it is more

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-18 Thread JonY
On 3/18/2013 19:34, LRN wrote: > On 18.03.2013 13:35, JonY wrote: >> Before anyone does anything, see __wgetmainargs >> . > >> It can expand wildcards. Since it already provides argc/argv/env, >> it is more a less a drop-in replacement for th

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-18 Thread LRN
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 18.03.2013 13:35, JonY wrote: > Before anyone does anything, see __wgetmainargs > . > > It can expand wildcards. Since it already provides argc/argv/env, > it is more a less a drop-in replacem

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-18 Thread JonY
On 3/18/2013 19:21, Janne Hyvärinen wrote: > On 18.3.2013 11:35, JonY wrote: >> Before anyone does anything, see __wgetmainargs >> . >> >> It can expand wildcards. Since it already provides argc/argv/env, it is >> more a less a drop-in replacem

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-18 Thread Janne Hyvärinen
On 18.3.2013 11:35, JonY wrote: Before anyone does anything, see __wgetmainargs . It can expand wildcards. Since it already provides argc/argv/env, it is more a less a drop-in replacement for the main() arguments. MSVC also comes with htt

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-18 Thread Erik de Castro Lopo
JonY wrote: > Before anyone does anything, see __wgetmainargs > . > > It can expand wildcards. Since it already provides argc/argv/env, it is > more a less a drop-in replacement for the main() arguments. +1 Erik --

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-18 Thread JonY
On 3/18/2013 09:55, LRN wrote: > On 18.03.2013 02:10, JonY wrote: >> On 3/17/2013 23:01, LRN wrote: All those ifdefs will at least be confined rather than spread out through the code. >>> I did it plibc-style: >>> >>> in compat.h: #if defined(_WIN32) #define FOPEN >>> grabbag__fopen_utf8_

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-18 Thread JonY
On 3/18/2013 14:55, Erik de Castro Lopo wrote: > Brian Willoughby wrote: > >> I believe that shell does handle wildcards on all Unix variants, >> including OSX. > > Yes. > >> Since Windows does not handle them, I suggest that the >> main flac code not be littered with code that's not necessa

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-17 Thread Erik de Castro Lopo
Brian Willoughby wrote: > I believe that shell does handle wildcards on all Unix variants, > including OSX. Yes. > Since Windows does not handle them, I suggest that the > main flac code not be littered with code that's not necessary on the > primary platforms. No, the flac code will not

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-17 Thread Brian Willoughby
On Mar 17, 2013, at 03:57, LRN wrote: > /me looks at chmod and utime wrappers: > Ah, i knew i've missed something! :) > Also, i didn't consider wildcards (i thought shell was supposed to > handle them...). I believe that shell does handle wildcards on all Unix variants, including OSX. Since Wi

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-17 Thread LRN
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 18.03.2013 02:37, Erik de Castro Lopo wrote: > JonY wrote: >> On 3/17/2013 23:01, LRN wrote: All those ifdefs will at least be confined rather than spread out through the code. >>> I did it plibc-style: >>> >>> in compat.h: #if defined(_W

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-17 Thread LRN
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 18.03.2013 02:10, JonY wrote: > On 3/17/2013 23:01, LRN wrote: >>> All those ifdefs will at least be confined rather than spread >>> out through the code. >> I did it plibc-style: >> >> in compat.h: #if defined(_WIN32) #define FOPEN >> grabbag__fop

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-17 Thread Erik de Castro Lopo
JonY wrote: > On 3/17/2013 23:01, LRN wrote: > >> All those ifdefs will at least be confined rather than spread out > >> through the code. > > I did it plibc-style: > > > > in compat.h: > > #if defined(_WIN32) > > #define FOPEN grabbag__fopen_utf8_wrapper > > #else > > #define FOPEN fopen > > #e

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-17 Thread JonY
On 3/17/2013 23:01, LRN wrote: >> All those ifdefs will at least be confined rather than spread out >> through the code. > I did it plibc-style: > > in compat.h: > #if defined(_WIN32) > #define FOPEN grabbag__fopen_utf8_wrapper > #else > #define FOPEN fopen > #endif > > in grabbag: > #if defined

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-17 Thread LRN
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17.03.2013 18:55, JonY wrote: > On 3/17/2013 18:37, Erik de Castro Lopo wrote: >> JonY wrote: >> >>> On 3/17/2013 10:33, Janne Hyvärinen wrote: Here's a patch that makes MSVC compiled flac.exe able to use wildcards and encode/decode files

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-17 Thread JonY
On 3/17/2013 18:37, Erik de Castro Lopo wrote: > JonY wrote: > >> On 3/17/2013 10:33, Janne Hyvärinen wrote: >>> Here's a patch that makes MSVC compiled flac.exe able to use wildcards >>> and encode/decode files with Unicode characters in names. It may not be >>> the prettiest code but it fulfills

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-17 Thread LRN
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17.03.2013 06:33, Janne Hyvärinen wrote: > Here's a patch that makes MSVC compiled flac.exe able to use > wildcards and encode/decode files with Unicode characters in names. > It may not be the prettiest code but it fulfills its primary > purpose. I

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-17 Thread Erik de Castro Lopo
JonY wrote: > On 3/17/2013 10:33, Janne Hyvärinen wrote: > > Here's a patch that makes MSVC compiled flac.exe able to use wildcards > > and encode/decode files with Unicode characters in names. It may not be > > the prettiest code but it fulfills its primary purpose. > > I tried to alter FLAC code

Re: [flac-dev] Patch to add Unicode filename support for win32 flac

2013-03-16 Thread JonY
On 3/17/2013 10:33, Janne Hyvärinen wrote: > Here's a patch that makes MSVC compiled flac.exe able to use wildcards > and encode/decode files with Unicode characters in names. It may not be > the prettiest code but it fulfills its primary purpose. > I tried to alter FLAC code as little as possible.