Switch tab-indented files to 4-space indent

This commit is contained in:
Wolfgang Thaller
2019-08-18 13:21:00 +02:00
parent 9cb90cb3b0
commit e5185d23c3
133 changed files with 7879 additions and 7866 deletions
+34 -34
View File
@@ -11,43 +11,43 @@ namespace fs = boost::filesystem;
void MakeExecutable(string fn)
{
ResourceFile rsrcFile(fn);
if(!rsrcFile.read())
{
std::cerr << "Cannot read application file: " << fn << std::endl;
exit(1);
}
if(!rsrcFile.hasPlainDataFork())
{
std::cerr << "--make-executable can not be used with this data format.\n";
exit(1);
}
ResourceFile rsrcFile(fn);
if(!rsrcFile.read())
{
std::cerr << "Cannot read application file: " << fn << std::endl;
exit(1);
}
if(!rsrcFile.hasPlainDataFork())
{
std::cerr << "--make-executable can not be used with this data format.\n";
exit(1);
}
string headerString = "#!" RETRO68_PREFIX "/bin/LaunchAPPL\n";
string headerString = "#!" RETRO68_PREFIX "/bin/LaunchAPPL\n";
bool hadShebang = false;
if(rsrcFile.data.size())
{
if(headerString.substr(2) == "#!")
{
string::size_type eol = headerString.find('\n');
if(eol != string::npos && eol >= 13 && eol < 4096)
{
if(headerString.substr(eol-11,11) == "/LaunchAPPL")
hadShebang = true;
}
}
bool hadShebang = false;
if(rsrcFile.data.size())
{
if(headerString.substr(2) == "#!")
{
string::size_type eol = headerString.find('\n');
if(eol != string::npos && eol >= 13 && eol < 4096)
{
if(headerString.substr(eol-11,11) == "/LaunchAPPL")
hadShebang = true;
}
}
if(!hadShebang)
{
std::cerr << "Unfortunately, the application already has a data fork.\n";
std::cerr << "LaunchAPPL --make-executable does not currently work for PowerPC apps.\n";
// TODO: if it's a PEF container, move it back a little and update cfrg
exit(1);
}
}
if(!hadShebang)
{
std::cerr << "Unfortunately, the application already has a data fork.\n";
std::cerr << "LaunchAPPL --make-executable does not currently work for PowerPC apps.\n";
// TODO: if it's a PEF container, move it back a little and update cfrg
exit(1);
}
}
std::fstream(fn, std::ios::in | std::ios::out | std::ios::binary) << headerString;
std::fstream(fn, std::ios::in | std::ios::out | std::ios::binary) << headerString;
fs::permissions(fs::path(fn), fs::owner_exe | fs::group_exe | fs::others_exe | fs::add_perms);
fs::permissions(fs::path(fn), fs::owner_exe | fs::group_exe | fs::others_exe | fs::add_perms);
}