diff --git a/pedi.cpp b/pedi.cpp
index 16455c6b506d73b7de0a121a6e78d5feb0ceafc1..a56c75260a61e03956a667c028fb35d2aeba0beb 100644
--- a/pedi.cpp
+++ b/pedi.cpp
@@ -14,6 +14,9 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <dirent.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <assert.h>
 
 using namespace std;
 
@@ -173,6 +176,23 @@ void parse_args(int argc, char* argv[])
 			exit(1);
 		}
 	}
+
+	char cwd[PATH_MAX] = {};
+	char real_cwd[PATH_MAX] = {};
+	char real_install[PATH_MAX] = {};
+	const auto cwd_res       = getcwd(cwd, sizeof(cwd));
+	const auto realpath_res1 = realpath(cwd,real_cwd);
+	const auto realpath_res2 = realpath(my_options.install_dir.c_str(),real_install);
+	assert(cwd_res       != nullptr);
+	assert(realpath_res1 != nullptr);
+	assert(realpath_res1 != nullptr);
+
+	if(string(real_cwd) == real_install)
+	{
+		cout << "Whoa, you don't want me to install into your root location, do you?!" << endl;
+		cout << "You'll lose all your files in " << real_cwd << endl;
+		exit(1);
+	}
 }