char *s = strdup (combine.c_str ());
if (be_verbose_global)
- progress_indication (_f ("Setting %s to %s\n" , key, value.c_str ()));
+ progress_indication (_f ("Setting %s to %s" , key, value.c_str ())
+ + "\n");
return putenv (s);
}
#endif /* __MINGW32__ */
if (argv0_abs.empty ())
- programming_error ("can't find absolute argv0.");
+ programming_error ("cannot find absolute argv0");
}
string bindir = dir_name (argv0_abs);
read_relocation_file (string filename)
{
if (be_verbose_global)
- progress_indication (_f ("Relocation file %s\n", filename.c_str ()));
+ progress_indication (_f ("Relocation file: %s", filename.c_str ())
+ + "\n");
char const *cname = filename.c_str ();
FILE *f = fopen (cname, "r");
if (!f)
- error (_f ("can't open file %s", cname));
+ error (_f ("cannot open file: `%s'", cname));
while (!feof (f))
{
else if (command == "prependdir")
prepend_env_path (variable.c_str (), value);
else
- error ( _f("Unknown relocation command %s", command));
+ error (_f ("Unknown relocation command %s", command));
}
fclose (f);
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 ());
+ }
}