Compare commits
No commits in common. "852c931d8b09f926fe561978cdee1ddbf00343dc" and "d8068a6f5f8999dd274e25603a15df2f987af3b3" have entirely different histories.
852c931d8b
...
d8068a6f5f
2 changed files with 5 additions and 19 deletions
|
@ -104,9 +104,6 @@ void cleanup_temp_filename_delete(void ***ptrs_array) {
|
|||
}
|
||||
|
||||
char *filename_to_absolute_path(const char *filename) {
|
||||
#if SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_COSMOPOLITAN || \
|
||||
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_MAC || \
|
||||
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_LINUX
|
||||
__attribute__((cleanup(free_malloced_memory))) void *path =
|
||||
malloc(strlen(filename) + 1);
|
||||
strncpy(path, filename, strlen(filename) + 1);
|
||||
|
@ -141,8 +138,6 @@ char *filename_to_absolute_path(const char *filename) {
|
|||
strlen(filename_basename) + 1);
|
||||
|
||||
return fullpath;
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int write_files_fn(void *data, void *ud) {
|
||||
|
@ -712,12 +707,8 @@ int write_files_fn(void *data, void *ud) {
|
|||
|
||||
// Need to get abs_path for checking/setting a flag before storing flags.
|
||||
// Get absolute path.
|
||||
__attribute__((cleanup(free_malloced_memory))) void *abs_path = NULL;
|
||||
#if SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_COSMOPOLITAN || \
|
||||
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_MAC || \
|
||||
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_LINUX
|
||||
abs_path = realpath(file_info->filename, NULL);
|
||||
#endif
|
||||
__attribute__((cleanup(free_malloced_memory))) void *abs_path =
|
||||
realpath(file_info->filename, NULL);
|
||||
__attribute__((cleanup(free_malloced_memory))) void *rel_path = NULL;
|
||||
if (abs_path) {
|
||||
// Get relative path.
|
||||
|
@ -882,12 +873,8 @@ int filenames_to_abs_map_fn(void *data, void *ud) {
|
|||
|
||||
// Try putting all parent dirs up to current working directory.
|
||||
// First get absolute path to current working directory.
|
||||
__attribute__((cleanup(free_malloced_memory))) void *cwd_dirname = NULL;
|
||||
#if SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_COSMOPOLITAN || \
|
||||
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_MAC || \
|
||||
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_LINUX
|
||||
cwd_dirname = realpath(".", NULL);
|
||||
#endif
|
||||
__attribute__((cleanup(free_malloced_memory))) void *cwd_dirname =
|
||||
realpath(".", NULL);
|
||||
if (!cwd_dirname) {
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -388,8 +388,7 @@ SDArchiverLinkedList *simple_archiver_parsed_to_filenames(
|
|||
strcmp(dir_entry->d_name, "..") == 0) {
|
||||
continue;
|
||||
}
|
||||
// fprintf(stderr, "dir entry in %s is %s\n", next,
|
||||
// dir_entry->d_name);
|
||||
fprintf(stderr, "dir entry in %s is %s\n", next, dir_entry->d_name);
|
||||
int combined_size = strlen(next) + strlen(dir_entry->d_name) + 2;
|
||||
char *combined_path = malloc(combined_size);
|
||||
snprintf(combined_path, combined_size, "%s/%s", next,
|
||||
|
|
Loading…
Reference in a new issue