rio: 0.0.36 -> 0.0.37
[NixPkgs.git] / pkgs / applications / editors / codeblocks / writable-projects.patch
blob3b6364a52a1c784a5d40989291d3437d74c22d5a
1 diff --git a/src/plugins/scriptedwizard/wiz.cpp b/src/plugins/scriptedwizard/wiz.cpp
2 index 0eb4b27..7d469fe 100644
3 --- a/src/plugins/scriptedwizard/wiz.cpp
4 +++ b/src/plugins/scriptedwizard/wiz.cpp
5 @@ -785,6 +785,13 @@ void Wiz::CopyFiles(cbProject* theproject, const wxString& prjdir, const wxStri
8 if (do_copy) wxCopyFile(srcfile, dstfile, true);
9 + // Noticed! Files in Nix Store are readonly, so make the copied file writable
10 + if (do_copy)
11 + {
12 + struct stat statbuf;
13 + if (!::stat(dstfile.mb_str(), &statbuf))
14 + ::chmod(dstfile.mb_str(), statbuf.st_mode | 0200);
15 + }
17 // and add it to the project
18 fname.MakeRelativeTo(prjdir);