/* -----------------------------------------------------------------------------
- * $Id: RtsFlags.c,v 1.68 2003/04/21 14:45:28 sof Exp $
+ * $Id: RtsFlags.c,v 1.72 2003/11/12 17:49:09 sof Exp $
*
* (c) The AQUA Project, Glasgow University, 1994-1997
* (c) The GHC Team, 1998-1999
/*
* Split argument lists
*/
-int prog_argc = 0; /* an "int" so as to match normal "argc" */
+int prog_argc = 0; /* an "int" so as to match normal "argc" */
char **prog_argv = NULL;
+char *prog_name = NULL; /* 'basename' of prog_argv[0] */
int rts_argc = 0; /* ditto */
char *rts_argv[MAX_RTS_ARGS];
" -? Prints this message and exits; the program is not executed",
"",
" -K<size> Sets the maximum stack size (default 1M) Egs: -K32k -K512k",
-" -k<size> Sets the initial thread stack size (default 1k) Egs: -K4k -K2m",
+" -k<size> Sets the initial thread stack size (default 1k) Egs: -k4k -k2m",
"",
" -A<size> Sets the minimum allocation area size (default 256k) Egs: -A1m -A10k",
" -M<size> Sets the maximum heap size (default unlimited) Egs: -M256k -M1G",
0
};
-static __inline__ rtsBool
+STATIC_INLINE rtsBool
strequal(const char *a, const char * b)
{
return(strcmp(a, b) == 0);
char *last_slash;
/* Remove directory from argv[0] -- default files in current directory */
-
- if ((last_slash = (char *) strrchr(argv[0], '/')) != NULL)
- strcpy(argv[0], last_slash+1);
+ if ((last_slash = (char *) strrchr(argv[0],
+#if !defined(mingw32_TARGET_OS)
+ '/')
+#else
+ '\\')
+#endif
+ ) != NULL) {
+ prog_name = last_slash+1;
+ } else {
+ prog_name = argv[0];
+ }
total_arg = *argc;
arg = 1;