diff options
| author | Max Khon <fjoe@FreeBSD.org> | 2004-06-14 20:56:00 +0000 |
|---|---|---|
| committer | Max Khon <fjoe@FreeBSD.org> | 2004-06-14 20:56:00 +0000 |
| commit | 694ecd186a9b12f5115b130cb96dc3428c8dc76b (patch) | |
| tree | f1a6e73aac755d8e00dfb5f10ac6a3618d9becf9 /misc/mc/files/patch-src-dir.c | |
| parent | - Strip binaries (diff) | |
- Fix CAN-2004-0226, CAN-2004-0231, CAN-2004-0232.
- Do not use :: in patch file names.
- Patch for CAN-2003-1023 is now contained in patch-vfs-direntry.c.
- Bump PORTREVISION.
Submitted by: Jakub Jelinek <jakub@redhat.com>
Diffstat (limited to 'misc/mc/files/patch-src-dir.c')
| -rw-r--r-- | misc/mc/files/patch-src-dir.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/misc/mc/files/patch-src-dir.c b/misc/mc/files/patch-src-dir.c new file mode 100644 index 000000000000..e9a97a35aefa --- /dev/null +++ b/misc/mc/files/patch-src-dir.c @@ -0,0 +1,53 @@ +--- src/dir.c.orig Tue Jan 21 06:41:45 2003 ++++ src/dir.c Tue Jun 15 03:15:09 2004 +@@ -503,9 +503,11 @@ + } + + if (next_free) { ++ char *path = vfs_canon ("."); + /* Add ".." except the root directory */ +- if (strcmp (vfs_canon ("."), "/") != 0) ++ if (strcmp (path, "/") != 0) + add_dotdot_to_list (list, next_free++); ++ g_free (path); + do_sort (list, sort, next_free - 1, reverse, case_sensitive); + } else { + tree_store_end_check (); +@@ -576,7 +578,7 @@ + int i, status, link_to_dir, stale_link; + struct stat buf; + int marked_cnt; +- GHashTable *marked_files = g_hash_table_new (g_str_hash, g_str_equal); ++ GHashTable *marked_files; + + tree_store_start_check_cwd (); + dirp = mc_opendir ("."); +@@ -587,6 +589,7 @@ + return set_zero_dir (list); + } + ++ marked_files = g_hash_table_new (g_str_hash, g_str_equal); + alloc_dir_copy (list->size); + for (marked_cnt = i = 0; i < count; i++) { + dir_copy.list[i].fnamelen = list->list[i].fnamelen; +@@ -622,6 +625,7 @@ + clean_dir (&dir_copy, count); + */ + tree_store_end_check (); ++ g_hash_table_destroy (marked_files); + return next_free; + } + +@@ -655,9 +659,11 @@ + tree_store_end_check (); + g_hash_table_destroy (marked_files); + if (next_free) { ++ char *path = vfs_canon ("."); + /* Add ".." except the root directory */ +- if (strcmp (vfs_canon ("."), "/") != 0) ++ if (strcmp (path, "/") != 0) + add_dotdot_to_list (list, next_free++); ++ g_free (path); + do_sort (list, sort, next_free - 1, rev, case_sensitive); + } else + next_free = set_zero_dir (list); |
