[Python-checkins] python/dist/src/Python sysmodule.c,2.113,2.114
gvanrossum@users.sourceforge.net
gvanrossum@users.sourceforge.net
Wed, 19 Feb 2003 07:25:13 -0800
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1:/tmp/cvs-serv17920/Python
Modified Files:
sysmodule.c
Log Message:
- sys.path[0] (the directory from which the script is loaded) is now
turned into an absolute pathname, unless it is the empty string.
(SF patch #664376, by Skip Montanaro.)
Index: sysmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v
retrieving revision 2.113
retrieving revision 2.114
diff -C2 -d -r2.113 -r2.114
*** sysmodule.c 5 Feb 2003 23:13:00 -0000 2.113
--- sysmodule.c 19 Feb 2003 15:24:39 -0000 2.114
***************
*** 994,998 ****
PySys_SetArgv(int argc, char **argv)
{
! #ifdef MS_WINDOWS
char fullpath[MAX_PATH];
#endif
--- 994,1000 ----
PySys_SetArgv(int argc, char **argv)
{
! #if defined(HAVE_REALPATH)
! char fullpath[MAXPATHLEN];
! #elif defined(MS_WINDOWS)
char fullpath[MAX_PATH];
#endif
***************
*** 1060,1065 ****
}
#else /* All other filename syntaxes */
! if (argc > 0 && argv0 != NULL)
p = strrchr(argv0, SEP);
if (p != NULL) {
#ifndef RISCOS
--- 1062,1073 ----
}
#else /* All other filename syntaxes */
! if (argc > 0 && argv0 != NULL) {
! #if defined(HAVE_REALPATH)
! if (realpath(argv0, fullpath)) {
! argv0 = fullpath;
! }
! #endif
p = strrchr(argv0, SEP);
+ }
if (p != NULL) {
#ifndef RISCOS