#include <config.h>
#endif
-#include "glibconfig.h"
-
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/param.h>
#endif
-#ifdef G_OS_WIN32
-# define STRICT /* Strict typing, please */
-# include <windows.h>
-# include <errno.h>
-# include <ctype.h>
-# ifdef _MSC_VER
-# include <io.h>
-# endif /* _MSC_VER */
-#endif /* G_OS_WIN32 */
-
/* implement Glib's inline functions
*/
#define G_INLINE_FUNC extern
#define G_PATH_LENGTH 2048
#endif
+#ifdef G_OS_WIN32
+# define STRICT /* Strict typing, please */
+# include <windows.h>
+# include <ctype.h>
+# include <direct.h>
+# include <io.h>
+#endif /* G_OS_WIN32 */
+
const guint glib_major_version = GLIB_MAJOR_VERSION;
const guint glib_minor_version = GLIB_MINOR_VERSION;
const guint glib_micro_version = GLIB_MICRO_VERSION;
gchar*
g_get_current_dir (void)
{
- gchar *buffer;
- gchar *dir;
+ gchar *buffer = NULL;
+ gchar *dir = NULL;
static gulong max_len = (G_PATH_LENGTH == -1) ? 2048 : G_PATH_LENGTH;
/* We don't use getcwd(3) on SUNOS, because, it does a popen("pwd")
*buffer = 0;
dir = getwd (buffer);
#else /* !sun */
- while (1)
+ while (max_len < G_MAXULONG / 2)
{
buffer = g_new (gchar, max_len + 1);
*buffer = 0;
g_free (homepath);
}
}
-#endif /* !G_OS_WIN32 */
+#endif /* G_OS_WIN32 */
#ifdef HAVE_PWD_H
{