From 5e089a51ab006fb0db0859b31891c36e4620491f Mon Sep 17 00:00:00 2001
From: toole1 <toole1@6fbd10e7-183d-0410-a318-cb416676e4f2>
Date: Sun, 29 Jan 2012 06:55:21 +0000
Subject: [PATCH] monad 3.0.0.1 bugfix for kyle

git-svn-id: https://subversion.cs.illinois.edu/svn/cs225@5916 6fbd10e7-183d-0410-a318-cb416676e4f2
---
 monad                   | 10 +++++-----
 source/Makefile.proxy   |  5 +++--
 source/monad.cpp        |  3 +++
 source/monad_shared.cpp |  2 +-
 source/util.cpp         |  2 +-
 5 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/monad b/monad
index 95e2c77..36eb538 100755
--- a/monad
+++ b/monad
@@ -11,12 +11,12 @@ while [ -h "$SOURCE" ] ; do
 	fi;
 done
 MONAD_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-SOURCE_DIR=$MONAD_DIR/source
+SOURCE_DIR="$MONAD_DIR/source"
 CALLING_DIR=`pwd`
 
-svn up $MONAD_DIR -q
-make -C $SOURCE_DIR -q
+svn up "$MONAD_DIR" -q
+make -C "$SOURCE_DIR" -q
 if [ "$?" -ne 0 ]; then
-	make -C $SOURCE_DIR --quiet
+	make -C "$SOURCE_DIR" --quiet
 fi
-$SOURCE_DIR/pure-monad $@
+"$SOURCE_DIR/pure-monad" $@
diff --git a/source/Makefile.proxy b/source/Makefile.proxy
index af9d5dd..4552196 100644
--- a/source/Makefile.proxy
+++ b/source/Makefile.proxy
@@ -22,8 +22,9 @@ all: $(TESTEXE)
 endif
 
 LIBS:=
-IS_LIBRT:=$(shell echo "int main(){}" | g++ -o /dev/null -x c++ - -lrt &>/dev/null ; echo $$?)
-IS_LIBPNG:=$(shell echo "int main(){}" | g++ -o /dev/null -x c++ - -lpng &>/dev/null ; echo $$?)
+# Using temp instead of /dev/null to work on cygwin
+IS_LIBRT:=$(shell echo "int main(){}" | g++ -o temp -x c++ - -lrt &>/dev/null ; echo $$? ; rm -f temp)
+IS_LIBPNG:=$(shell echo "int main(){}" | g++ -o temp -x c++ - -lpng &>/dev/null ; echo $$? ; rm -f temp)
 ifeq ($(IS_LIBRT),0)
 LIBS+= -lrt
 endif
diff --git a/source/monad.cpp b/source/monad.cpp
index 5c3cc0f..c5ad909 100644
--- a/source/monad.cpp
+++ b/source/monad.cpp
@@ -269,6 +269,9 @@ void monad::processArgs(int argc, const char * const * argv)
 		tempFolder  = "./" + assignment_base + "_temp/";
 
 	// Find source folder (i.e. ../mp1)
+	// TODO (toole1): I'm not sure if we should really use updateFolder
+	// vs getFolder here, and I've forgotten if the original reasoning
+	// was deeper than I have the _solution in ../
 	if (opts::solution)
 		sourceFolder = updateFolder(assignment_base + "_solution/", false);
 	else
diff --git a/source/monad_shared.cpp b/source/monad_shared.cpp
index f8449b9..2866493 100644
--- a/source/monad_shared.cpp
+++ b/source/monad_shared.cpp
@@ -15,7 +15,7 @@ namespace versioninfo
 {
 const char * official_name = "Monad Autograder";
 const char * version_name  = "mazecity";
-const Version version_num  = Version(3, 0, 0, 0);
+const Version version_num  = Version(3, 0, 0, 1);
 const char * date          = "18 Jan 2012";
 }
 
diff --git a/source/util.cpp b/source/util.cpp
index 6d22fad..a374403 100644
--- a/source/util.cpp
+++ b/source/util.cpp
@@ -657,7 +657,7 @@ string getcwdstr()
 	string cwdstr(buffer);
 	delete buffer;
 
-	return cwdstr;
+	return cwdstr + "/";
 }
 
 
-- 
GitLab