mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-09-25 01:24:14 +00:00
Simplify make_directories API
* src/extract.c (make_directories): Return a 3-way int rather than an int (actually a bool) and another optional bool via a pointer. All callers changed. In comment, make it clearer what the return value means. Also, improve behavior in a small way: when issuing a diagnostic on MS-Windows-like systems, use the original directory name rather than translating '\\' to '/'.
This commit is contained in:
+1
-1
@@ -1139,7 +1139,7 @@ chdir_do (idx_t i, bool create)
|
||||
namebuf_add_dir (nbuf, ".");
|
||||
dir_with_dot = namebuf_finish (nbuf);
|
||||
}
|
||||
if (make_directories (dir_with_dot, NULL) == 0)
|
||||
if (0 <= make_directories (dir_with_dot))
|
||||
/* Directory created, retry */
|
||||
fd = openat (chdir_fd, curr->name,
|
||||
open_searchdir_how.flags & ~O_NOFOLLOW);
|
||||
|
||||
Reference in New Issue
Block a user