Commits

atheros  committed bc4c4e3

Replaced all exit() calls with love.event.quit()
Removed some debug output

  • Participants
  • Parent commits e4eb7e2

Comments (0)

Files changed (12)

File src/modules/filesystem/physfs/Filesystem.cpp

 		std::string dir = dirname(path.c_str());
 		while (1)
 		{
-//			printf("DEBUG: testing path [%s]\n", dir.c_str());
 			if (restrictedArchivePaths.find(dir) != restrictedArchivePaths.end())
 			{
 				// path is correct, accept this archive
 		while (lua_next(L, 1) != 0) {
 			/* uses 'key' (at index -2) and 'value' (at index -1) */
 			path = lua_tostring(L, -1);
-//			printf("DEBUG: adding restricted path [%s]\n", path.c_str());
 
 			// fix the path
 			if (path[path.size()-1] == '/')
 			}
 
 			// add path
-			printf("DEBUG: adding path %s\n", path.c_str());
 			restrictedArchivePaths.insert(path);
 
 			/* removes 'value'; keeps 'key' for next iteration */

File tests/basename/main.lua

-
-function exit()
-	love.event.push("q")
-end
-
 
 TEST_NO=0
 function test(path, basename)
 	test("/", "")
 	test("foo", "foo")
 	test("foo/bar", "bar")
-	exit()
+	love.event.quit()
 end

File tests/basic-automount-at/main.lua

-
-function exit()
-	love.event.push("q")
-end
 
 function love.load()
 	local found = false
 	
 	if not found then
 		print("Mounting of archive somehow failed!")
-		return exit()
+		return love.event.quit()
 	else
 		print("The message from mounted archive: "..love.filesystem.read("addons/TextFile.txt"))
 	end
 		print("Umount succeeded when it should have failed! Hopefully it didn't kill any kittens...")
 	end
 
-	return exit()
+	return love.event.quit()
 end

File tests/basic-automount-multi/main.lua

-
-function exit()
-	love.event.push("q")
-end
 
 function love.load()
 	local found = false
 	
 	if not found then
 		print("Mounting of archive somehow failed!")
-		return exit()
+		return love.event.quit()
 	else
 		print("The message from mounted archive: "..love.filesystem.read("TextFile.txt"))
 		print("The message from mounted archive: "..love.filesystem.read("TextFile2.txt"))
 		print("Umount succeeded when it should have failed! Hopefully it didn't kill any kittens...")
 	end
 
-	return exit()
+	return love.event.quit()
 end

File tests/basic-automount-wildcard/main.lua

-
-function exit()
-	love.event.push("q")
-end
 
 function love.load()
 	local found = false
 		print("found file \"" .. file .. "\"")
 	end
 	
-	exit();
+	love.event.quit()
 end

File tests/basic-automount/main.lua

-
-function exit()
-	love.event.push("q")
-end
 
 function love.load()
 	local found = false
 	
 	if not found then
 		print("Mounting of archive somehow failed!")
-		return exit()
+		return love.event.quit()
 	else
 		print("The message from mounted archive: "..love.filesystem.read("TextFile.txt"))
 	end
 		print("Umount succeeded when it should have failed! Hopefully it didn't kill any kittens...")
 	end
 
-	return exit()
+	return love.event.quit()
 end

File tests/basic-check-restrictions/main.lua

-
-function exit()
-	love.event.push("q")
-end
 
 function love.load()
 	-- mount the archive
 	
 	if code == true then
 		print("Erm... I managed to mount /test.zip from outside permitted space! EPIC FAIL!")
-		exit()
+		return love.event.quit()
 	else
 		print("Got an error while trying to mount a zip from outside permitted space! SUCCESS!")
 	end
 		print("I managed to mount /addons/test.zip! SUCCESS")
 		-- added leading slash to test if it won't break anything
 		love.filesystem.umount("/addons/test.zip")
-		exit()
 	end
 	
 
-	return exit()
+	return love.event.quit()
 end

File tests/basic-mount-lines/main.lua

-
-function exit()
-	love.event.push("q")
-end
 
 function love.load()
 	-- mount the archive
 	print("Now I'm going to save some kittens by umounting that archive!")
 	love.filesystem.umount("test.zip")
 		
-	return exit()
+	return love.event.quit()
 end

File tests/basic-mount/main.lua

-
-function exit()
-	love.event.push("q")
-end
 
 function love.load()
 	-- mount the archive
 	
 	if not found then
 		print("Mounting of archive somehow failed!")
-		return exit()
+		return love.event.quit()
 	else
 		print("The message from mounted archive: "..love.filesystem.read("TextFile.txt"))
 	end
 		print("Umounting of archive somehow failed! Message reads: "..love.filesystem.read("TextFile.txt"))
 	end
 	
-	return exit()
+	return love.event.quit()
 end

File tests/basic-overloading/main.lua

-
-function exit()
-	love.event.push("q")
-end
 
 function love.load()
 	-- mount the archive
 	
 	if res == false then
 		print("Failed to mount archive: " .. msg)
-		return exit()
+		return love.event.quit()
 	end
 	
 	
 	print("Now let's confirm archive is no longer available")
 	print("Message reads: "..love.filesystem.read("TextFile.txt"))
 	
-	return exit()
+	return love.event.quit()
 end

File tests/dirname/main.lua

-
-function exit()
-	love.event.push("q")
-end
-
 
 TEST_NO=0
 function test(path, dirname)
 	test("/", "")
 	test("foo", "")
 	test("foo/bar", "foo")
-	exit()
+	love.event.quit()
 end

File tests/globbing/main.lua

-
-function exit()
-	love.event.push("q")
-end
 
 function love.load()
 	local found = false
 	print()
 	
 	
-	return exit()
+	love.event.quit()
 end