1 | diff -aur src/cmd.c newsrc/cmd.c |
---|
2 | --- src/cmd.c 2010-02-01 10:17:32.000000000 +0100 |
---|
3 | +++ newsrc/cmd.c 2010-02-20 11:05:00.000000000 +0100 |
---|
4 | @@ -931,7 +931,8 @@ |
---|
5 | char *s; |
---|
6 | char *d; |
---|
7 | |
---|
8 | - /* suggest the full path for symlink */ |
---|
9 | + /* suggest the full path for symlink, and either the full or |
---|
10 | + relative path to the file it points to */ |
---|
11 | s = concat_dir_and_file (current_panel->cwd, fname); |
---|
12 | |
---|
13 | if (get_other_type () == view_listing) { |
---|
14 | @@ -940,6 +941,10 @@ |
---|
15 | d = g_strdup (fname); |
---|
16 | } |
---|
17 | |
---|
18 | + if ( 2 == symbolic_link) { |
---|
19 | + s = diff_two_paths ((other_panel->cwd),s); |
---|
20 | + } |
---|
21 | + |
---|
22 | symlink_dialog (s, d, &dest, &src); |
---|
23 | g_free (d); |
---|
24 | g_free (s); |
---|
25 | @@ -974,6 +979,19 @@ |
---|
26 | } |
---|
27 | } |
---|
28 | |
---|
29 | + |
---|
30 | +void relative_symlink_cmd (void) |
---|
31 | +{ |
---|
32 | + char *filename = NULL; |
---|
33 | + filename = selection (current_panel)->fname; |
---|
34 | + |
---|
35 | + if (filename) { |
---|
36 | + do_link (2, filename); |
---|
37 | + } |
---|
38 | +} |
---|
39 | + |
---|
40 | + |
---|
41 | + |
---|
42 | void edit_symlink_cmd (void) |
---|
43 | { |
---|
44 | if (S_ISLNK (selection (current_panel)->st.st_mode)) { |
---|
45 | diff -aur src/cmddef.h newsrc/cmddef.h |
---|
46 | --- src/cmddef.h 2010-02-02 10:07:24.000000000 +0100 |
---|
47 | +++ newsrc/cmddef.h 2010-02-20 11:01:34.000000000 +0100 |
---|
48 | @@ -365,6 +365,7 @@ |
---|
49 | #define CK_ViewFileCmd 7071 |
---|
50 | #define CK_HelpCmd 7072 |
---|
51 | #define CK_MenuCmd 7073 |
---|
52 | +#define CK_RSymlinkCmd 7074 |
---|
53 | |
---|
54 | /* panels */ |
---|
55 | #define CK_PanelChdirOtherPanel 8001 |
---|
56 | diff -aur src/cmd.h newsrc/cmd.h |
---|
57 | --- src/cmd.h 2010-01-29 09:09:28.000000000 +0100 |
---|
58 | +++ newsrc/cmd.h 2010-02-20 10:56:18.000000000 +0100 |
---|
59 | @@ -47,6 +47,7 @@ |
---|
60 | void tree_cmd (void); |
---|
61 | void link_cmd (void); |
---|
62 | void symlink_cmd (void); |
---|
63 | +void relative_symlink_cmd (void); |
---|
64 | void edit_symlink_cmd (void); |
---|
65 | void reverse_selection_cmd (void); |
---|
66 | void unselect_cmd (void); |
---|
67 | diff -aur src/keybind.c newsrc/keybind.c |
---|
68 | --- src/keybind.c 2010-02-02 15:22:26.000000000 +0100 |
---|
69 | +++ newsrc/keybind.c 2010-02-20 11:23:39.154257870 +0100 |
---|
70 | @@ -348,6 +348,7 @@ |
---|
71 | #endif /* USE_NETCODE || ENABLE_VFS_SMB */ |
---|
72 | { "CmdSwapPanel", CK_SwapCmd }, |
---|
73 | { "CmdSymlink", CK_SymlinkCmd }, |
---|
74 | + { "CmdRSymlink", CK_RSymlinkCmd }, |
---|
75 | { "CmdTree", CK_TreeCmd }, |
---|
76 | { "CmdTreeBox", CK_TreeBoxCmd }, |
---|
77 | #ifdef USE_EXT2FSLIB |
---|
78 | @@ -852,6 +853,7 @@ |
---|
79 | { XCTRL ('r'), CK_CopyOtherReadlink, "C-r" }, |
---|
80 | { 'l', CK_LinkCmd, "l" }, |
---|
81 | { 's', CK_SymlinkCmd, "s" }, |
---|
82 | + { 'v', CK_RSymlinkCmd, "v" }, |
---|
83 | { XCTRL ('s'), CK_EditSymlinkCmd, "C-s" }, |
---|
84 | { 'i', CK_InfoCmd, "i" }, |
---|
85 | { 'q', CK_QuickViewCmd, "q" }, |
---|
86 | diff -aur src/main.c newsrc/main.c |
---|
87 | --- src/main.c 2010-02-02 15:22:26.000000000 +0100 |
---|
88 | +++ newsrc/main.c 2010-02-20 11:00:46.000000000 +0100 |
---|
89 | @@ -719,6 +719,7 @@ |
---|
90 | entries = g_list_append (entries, menu_entry_create (_("C&hmod"), CK_ChmodCmd)); |
---|
91 | entries = g_list_append (entries, menu_entry_create (_("&Link"), CK_LinkCmd)); |
---|
92 | entries = g_list_append (entries, menu_entry_create (_("&SymLink"), CK_SymlinkCmd)); |
---|
93 | + entries = g_list_append (entries, menu_entry_create (_("Relative symLin&k"), CK_RSymlinkCmd)); |
---|
94 | entries = g_list_append (entries, menu_entry_create (_("Edit s&ymlink"), CK_EditSymlinkCmd)); |
---|
95 | entries = g_list_append (entries, menu_entry_create (_("Ch&own"), CK_ChownCmd)); |
---|
96 | entries = g_list_append (entries, menu_entry_create (_("&Advanced chown"), CK_ChownAdvancedCmd)); |
---|
97 | @@ -1342,6 +1343,9 @@ |
---|
98 | case CK_SymlinkCmd: |
---|
99 | symlink_cmd (); |
---|
100 | break; |
---|
101 | + case CK_RSymlinkCmd: |
---|
102 | + relative_symlink_cmd (); |
---|
103 | + break; |
---|
104 | case CK_ToggleListingCmd: |
---|
105 | toggle_listing_cmd (); |
---|
106 | break; |
---|