Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • opensrc/pedi
1 result
Show changes
Commits on Source (2)
.sconsign.dblite
pedi.exe
pedi.o
*.swp
......@@ -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);
}
}
......@@ -349,6 +369,8 @@ void find_manifest_file(string &file)
auto line_no=0;
for( auto line=string() ; getline(input,line); )
{
if(my_options.verbose)
cout << "Processing line: " << line << endl;
auto tokens=split(trimmed(line).c_str(),' ');
if(tokens.size() == 0)
{
......