Fixes r727 not compiling on windows,

Fixes an old issue on Linux where the program couldn't be run from a symbolic to the executable.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@743 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2009-04-07 21:53:20 +00:00
parent 19ac89a38f
commit c98bfafb76
5 changed files with 86 additions and 69 deletions

10
main.c
View File

@@ -51,6 +51,7 @@
#include "windows.h"
#include "brush.h"
#include "palette.h"
#include "realpath.h"
#if defined(__WIN32__)
#include <windows.h>
@@ -61,10 +62,9 @@
#import <sys/param.h>
#elif defined(__FreeBSD__)
#import <sys/param.h>
#elif defined(__AROS__) || defined(__BEOS__) || defined(__MORPHOS__) || defined(__GP2X__)
#include "realpath.h"
#endif
#if defined (__WIN32__)
// On Windows, SDL_putenv is not present in any compilable header.
// It can be linked anyway, this declaration only avoids
@@ -271,11 +271,7 @@ void Analyze_command_line(int argc,char * argv[])
// On récupère le chemin complet du paramètre
// Et on découpe ce chemin en répertoire(path) + fichier(.ext)
#if defined(__WIN32__)
buffer=_fullpath(NULL,argv[index],MAX_PATH_CHARACTERS);
#else
buffer=realpath(argv[index],NULL);
#endif
buffer=Realpath(argv[index],NULL);
Extract_path(Main_file_directory, buffer);
Extract_filename(Main_filename, buffer);
free(buffer);