From d928aee37862094d6e177ece2a3e07bd0498b5c9 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Thu, 22 May 2008 01:59:39 +0000 Subject: Fix build breakage on Win32. --- src/ChangeLog | 4 ++++ src/lib/cfuns-c.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 81f8396a..8c8b3746 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2008-05-21 Gabriel Dos Reis + * lib/cfuns-c.c (oa_getenv): Fix thinko. + (oa_getcwd): Likewise. + * lib/cfuns-c.c (oa_access_file_for_read): Likewise. + * hyper/lex.c: Don't include hyper.h, hterror.h and sockio.h. Include node.h. * hyper/hyper.h: Don't include X11 headers. Include node.h. diff --git a/src/lib/cfuns-c.c b/src/lib/cfuns-c.c index bc6e10bd..2620be00 100644 --- a/src/lib/cfuns-c.c +++ b/src/lib/cfuns-c.c @@ -454,7 +454,7 @@ oa_getenv(const char* var) return NULL; } else if (len > BUFSIZE) { - buf = (char*) realloc(len); + buf = (char*) realloc(buf,len); len = GetEnvironmentVariable(var, buf, len); if (len == 0) { free(buf); @@ -474,7 +474,7 @@ oa_getcwd(void) int bufsz = 256; char* buf = (char*) malloc(bufsz); #ifdef __MINGW32__ - int n = GetCurrentDirectory(bufsz, bufsz); + int n = GetCurrentDirectory(bufsz, buf); if (n == 0) { perror("oa_getcwd"); exit(-1); @@ -508,7 +508,7 @@ OPENAXIOM_EXPORT int oa_access_file_for_read(const char* path) { #ifdef __MINGW32__ - GetFileAttributes(path) == INVALID_FILE_ATTRIBUTES ? -1 : 1; + return GetFileAttributes(path) == INVALID_FILE_ATTRIBUTES ? -1 : 1; #else return access(path, R_OK); #endif -- cgit v1.2.3