X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Frelocate.cc;h=d7f7888c4a6ecdf7e2d0401b8be4af941caecd26;hb=8147ff08f9b71d9f1ca71ca4c7b21e2250d1f18f;hp=8cb2b0861f25636ad4a01b3d603777e47f892a5a;hpb=9f3572d98bb948c9689cd1f75401a029451fa001;p=lilypond.git diff --git a/lily/relocate.cc b/lily/relocate.cc index 8cb2b0861f..d7f7888c4a 100644 --- a/lily/relocate.cc +++ b/lily/relocate.cc @@ -394,14 +394,11 @@ read_relocation_file (string filename) void read_relocation_dir (string dirname) { - DIR *dir = opendir (dirname.c_str ()); - - while (struct dirent *ent = readdir (dir)) - { - File_name name (ent->d_name); - if (name.ext_ == "reloc") - { - read_relocation_file (dirname + "/" + name.to_string ()); - } - } + if (DIR *dir = opendir (dirname.c_str ())) + while (struct dirent *ent = readdir (dir)) + { + File_name name (ent->d_name); + if (name.ext_ == "reloc") + read_relocation_file (dirname + "/" + name.to_string ()); + } }