| 1897 | |
| 1898 | /* |
| 1899 | * Dmitry Koteroff <d[at]koteroff.ru> |
| 1900 | * Patch to save selected items in environment variable. |
| 1901 | * This variable would be passed to extfs scripts and may be used |
| 1902 | * to optimize depacking performance. |
| 1903 | */ |
| 1904 | {{{{ |
| 1905 | char* env = g_strconcat("", NULL); |
| 1906 | for (i = 0; i < panel->count; i++) { |
| 1907 | char *prevEnv, *p; |
| 1908 | if (!panel->dir.list[i].f.marked) continue; |
| 1909 | p = concat_dir_and_file (panel->cwd, panel->dir.list[i].fname); |
| 1910 | prevEnv = env; |
| 1911 | env = g_strconcat(prevEnv, p, "\n", NULL); |
| 1912 | g_free(p); |
| 1913 | g_free(prevEnv); |
| 1914 | } |
| 1915 | setenv("MC_SELECTION", env, 1); |
| 1916 | g_free(env); |
| 1917 | char *cur = concat_dir_and_file (panel->cwd, source); |
| 1918 | setenv("MC_CURRENT", cur, 1); |
| 1919 | g_free(cur); |
| 1920 | }}}} |
| 1921 | |
| 1922 | |