aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-05-22 01:59:39 +0000
committerdos-reis <gdr@axiomatics.org>2008-05-22 01:59:39 +0000
commitd928aee37862094d6e177ece2a3e07bd0498b5c9 (patch)
tree97e5f50dc53cc10c6840e5d285adf9bd9640360b /src
parentdb5b6bc58c7d8307b8874b37793074f789eb626a (diff)
downloadopen-axiom-d928aee37862094d6e177ece2a3e07bd0498b5c9.tar.gz
Fix build breakage on Win32.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/lib/cfuns-c.c6
2 files changed, 7 insertions, 3 deletions
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 <gdr@cs.tamu.edu>
+ * 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