From 0989c6bca54d24b0b08655f3d1651c601be7ad66 Mon Sep 17 00:00:00 2001
From: Andrew Ferguson <adf@cs.brown.edu>
Date: Mon, 10 Dec 2012 22:16:18 -0500
Subject: [PATCH] Improve handling of directories with spaces

---
 setup-eclipse.sh | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/setup-eclipse.sh b/setup-eclipse.sh
index a39dc62d6..de92c3493 100755
--- a/setup-eclipse.sh
+++ b/setup-eclipse.sh
@@ -1,12 +1,11 @@
 #!/bin/bash
-
-d=$(dirname $0)
+d=$(dirname "$0")
 MAIN_CLASS=$1
 LIBRARIES=$2
 [ "${MAIN_CLASS}" ] || { echo "Run 'ant eclipse' to generate Eclipse project files"; exit 1; }
 
 
-cat >$d/.project <<EOF
+cat >"$d/.project" <<EOF
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
 	<name>floodlight</name>
@@ -27,7 +26,7 @@ cat >$d/.project <<EOF
 EOF
 
 
-cat >$d/.classpath <<EOF
+cat >"$d/.classpath" <<EOF
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="src" path="src/main/java" output="target/bin"/>
@@ -43,7 +42,7 @@ cat >>$d/.classpath <<EOF
 EOF
 done
 )
-cat >>$d/.classpath <<EOF
+cat >>"$d/.classpath" <<EOF
 	<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="output" path="target/bin"/>
 </classpath>
-- 
GitLab