Re: [AD] SF.net SVN: alleg:[11050] allegro/branches/4.9/src

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Friday 10 October 2008, tjaden@xxxxxxxxxx wrote:
>
> Modified: allegro/branches/4.9/src/win/wnewsys.c
> ===================================================================
> --- allegro/branches/4.9/src/win/wnewsys.c	2008-10-10 22:01:01 UTC (rev
> 11049) +++ allegro/branches/4.9/src/win/wnewsys.c	2008-10-10 23:37:56 UTC
> (rev 11050) @@ -349,9 +349,8 @@
>  static AL_CONST char *win_get_path(uint32_t id, char *dir, size_t size)
>  {
>     char path[MAX_PATH];
> -   uint32_t csidl = 0, path_len = MIN(size, MAX_PATH);
> +   uint32_t csidl = 0;
>     HRESULT ret = 0;
> -   HANDLE process = GetCurrentProcess();
>
>     memset(dir, 0, size);
>
> @@ -370,8 +369,6 @@
>        } break;
>
>        case AL_PROGRAM_PATH: { /* where the program is in */
> -         HMODULE module = GetModuleHandle(NULL); /* Get handle for this
> process */ -         DWORD mret = GetModuleFileNameEx(process, NULL, path,
> MAX_PATH); char *ptr = strrchr(path, '\\');
>           if (!ptr) { /* shouldn't happen */
>              return dir;
>
>

You've totally broken that one by removing those two calls. Sure, the 
variables are unused, but thats mainly because return values should probably 
be checked, and I didn't bother. GetModuleFileNameEx is what fills "path" in.

Probably shouldn't rip things out willy nilly like that.

-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/