std::string -> const char*

This commit is contained in:
Simon Quigley 2025-02-10 01:28:03 -06:00
parent 9517f6d74c
commit e5cf2ebd61

View File

@ -459,8 +459,8 @@ void create_tarball(const std::string &tarball_path,
if (stat(top_dir.c_str(), &file_stat) == 0) { if (stat(top_dir.c_str(), &file_stat) == 0) {
std::string uname = clean_utf8(getpwuid(file_stat.st_uid) ? getpwuid(file_stat.st_uid)->pw_name : "lugito"); std::string uname = clean_utf8(getpwuid(file_stat.st_uid) ? getpwuid(file_stat.st_uid)->pw_name : "lugito");
std::string gname = clean_utf8(getgrgid(file_stat.st_gid) ? getgrgid(file_stat.st_gid)->gr_name : "lugito"); std::string gname = clean_utf8(getgrgid(file_stat.st_gid) ? getgrgid(file_stat.st_gid)->gr_name : "lugito");
archive_entry_set_uname(entry, uname); archive_entry_set_uname(entry, uname.c_str());
archive_entry_set_gname(entry, gname); archive_entry_set_gname(entry, gname.c_str());
archive_entry_set_uid(entry, file_stat.st_uid); archive_entry_set_uid(entry, file_stat.st_uid);
archive_entry_set_gid(entry, file_stat.st_gid); archive_entry_set_gid(entry, file_stat.st_gid);
archive_entry_set_perm(entry, file_stat.st_mode); archive_entry_set_perm(entry, file_stat.st_mode);
@ -534,8 +534,8 @@ void create_tarball(const std::string &tarball_path,
if (stat(path.c_str(), &file_stat) == 0) { if (stat(path.c_str(), &file_stat) == 0) {
std::string uname = clean_utf8(getpwuid(file_stat.st_uid) ? getpwuid(file_stat.st_uid)->pw_name : "lugito"); std::string uname = clean_utf8(getpwuid(file_stat.st_uid) ? getpwuid(file_stat.st_uid)->pw_name : "lugito");
std::string gname = clean_utf8(getgrgid(file_stat.st_gid) ? getgrgid(file_stat.st_gid)->gr_name : "lugito"); std::string gname = clean_utf8(getgrgid(file_stat.st_gid) ? getgrgid(file_stat.st_gid)->gr_name : "lugito");
archive_entry_set_uname(entry, uname); archive_entry_set_uname(entry, uname.c_str());
archive_entry_set_gname(entry, gname); archive_entry_set_gname(entry, gname.c_str());
archive_entry_set_uid(entry, file_stat.st_uid); archive_entry_set_uid(entry, file_stat.st_uid);
archive_entry_set_gid(entry, file_stat.st_gid); archive_entry_set_gid(entry, file_stat.st_gid);
archive_entry_set_perm(entry, file_stat.st_mode); archive_entry_set_perm(entry, file_stat.st_mode);