From a74b33e6d278ad461c2eba2991e09cf54a1e4d72 Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Thu, 7 Nov 2013 02:07:02 -0700
Subject: Minor fixes


diff --git a/chicken.h b/chicken.h
index de48141..98f7071 100644
--- a/chicken.h
+++ b/chicken.h
@@ -2888,7 +2888,7 @@ C_path_to_executable(C_char *fname)
 
   while (get_next_image_info(0, &cookie, &info) == B_OK) {
     if (info.type == B_APP_IMAGE) {
-      C_strcat(buffer, info.name);
+      C_strcpy(buffer, info.name);
 
       for(i = C_strlen(buffer); i >= 0 && buffer[ i ] != '/'; --i);
 
diff --git a/library.c b/library.c
index b54b578..fedf35b 100644
--- a/library.c
+++ b/library.c
@@ -79,13 +79,14 @@ fast_read_line_from_file(C_word str, C_word port, C_word size) {
 static C_word
 fast_read_string_from_file(C_word dest, C_word port, C_word len, C_word pos)
 {
+  size_t m;
   int n = C_unfix (len);
   char * buf = ((char *)C_data_pointer (dest) + C_unfix (pos));
   C_FILEPTR fp = C_port_file (port);
 
   if(feof(fp)) return C_SCHEME_END_OF_FILE;
 
-  size_t m = fread (buf, sizeof (char), n, fp);
+  m = fread (buf, sizeof (char), n, fp);
 
   if (m < n) {
     if (ferror(fp)) /* Report to Scheme, which may retry, so clear errors */
-- 
1.8.3.4


From ed8542b12f0695222d24261d2ad97853f3f19cb1 Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Thu, 7 Nov 2013 02:55:03 -0700
Subject: Adjust include path


diff --git a/Makefile.haiku b/Makefile.haiku
index 7489637..077daf2 100644
--- a/Makefile.haiku
+++ b/Makefile.haiku
@@ -64,6 +64,7 @@ include $(SRCDIR)/defaults.make
 
 chicken-config.h: chicken-defaults.h
 	echo "/* GENERATED */" >$@
+	echo "#define C_TARGET_INCLUDE_HOME \"$(TARGET_PREFIX)/develop/headers/chicken\"" >>$@
 	echo "#define HAVE_DIRENT_H 1" >>$@
 	echo "#define HAVE_DLFCN_H 1" >>$@
 	echo "#define HAVE_INTTYPES_H 1" >>$@
-- 
1.8.3.4


From 04cdda51c590a1648c74be2565c29073f0c09562 Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Thu, 7 Nov 2013 03:04:04 -0700
Subject: Adjust develop library paths


diff --git a/Makefile.haiku b/Makefile.haiku
index 077daf2..6cab4fe 100644
--- a/Makefile.haiku
+++ b/Makefile.haiku
@@ -65,6 +65,8 @@ include $(SRCDIR)/defaults.make
 chicken-config.h: chicken-defaults.h
 	echo "/* GENERATED */" >$@
 	echo "#define C_TARGET_INCLUDE_HOME \"$(TARGET_PREFIX)/develop/headers/chicken\"" >>$@
+	echo "#define C_TARGET_LIB_HOME \"$(TARGET_PREFIX)/develop/lib\"" >>$@
+	echo "#define C_TARGET_STATIC_LIB_HOME \"$(TARGET_PREFIX)/develop/lib\"" >>$@
 	echo "#define HAVE_DIRENT_H 1" >>$@
 	echo "#define HAVE_DLFCN_H 1" >>$@
 	echo "#define HAVE_INTTYPES_H 1" >>$@
-- 
1.8.3.4


From ed3a7c3bee260c4b09c4559b4a53ce346482ea1f Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Thu, 7 Nov 2013 03:33:47 -0700
Subject: Adjust egg location


diff --git a/Makefile.haiku b/Makefile.haiku
index 6cab4fe..c7c2824 100644
--- a/Makefile.haiku
+++ b/Makefile.haiku
@@ -67,6 +67,7 @@ chicken-config.h: chicken-defaults.h
 	echo "#define C_TARGET_INCLUDE_HOME \"$(TARGET_PREFIX)/develop/headers/chicken\"" >>$@
 	echo "#define C_TARGET_LIB_HOME \"$(TARGET_PREFIX)/develop/lib\"" >>$@
 	echo "#define C_TARGET_STATIC_LIB_HOME \"$(TARGET_PREFIX)/develop/lib\"" >>$@
+	echo "#define EGGDIR \"$(TARGET_PREFIX)/non-packaged/lib/chicken/$(BINARY_VERSION)\"" >>$@
 	echo "#define HAVE_DIRENT_H 1" >>$@
 	echo "#define HAVE_DLFCN_H 1" >>$@
 	echo "#define HAVE_INTTYPES_H 1" >>$@
-- 
1.8.3.4

