-
diff --git a/ChangeLog b/ChangeLog
index 291791f..810ccdf 100644
a
|
b
|
|
| 1 | |
| 2 | 2009-01-05 Enrico Weigelt <weigelt@metux.de> |
| 3 | * core: most config/data pathenames are now hold in global |
| 4 | vars, initiallized in main.c |
| 5 | * vfs/extfs.c: config file now taken from $sysconfdir/mc |
| 6 | * vfs/sfs.c: config file now taken from $sysconfdir/mc |
| 7 | * core: mc.ext, mc.menu, mc.lib now taken from $sysconfdir/mc |
| 8 | * cedit: cedit.menu now taken from $sysconfdir/mc |
| 9 | |
1 | 10 | 2008-12-18 Roland Illig <roland.illig@gmx.de> |
2 | 11 | |
3 | 12 | * doc/mcedit.1: Documented the newly added filename:lineno |
-
diff --git a/doc/es/mc.1.in b/doc/es/mc.1.in
index 2a27306..839188a 100644
a
|
b
|
Abre el archivo |
1300 | 1300 | .I ~/.mc/bindings |
1301 | 1301 | en nuestro editor. El administrador puede optar por editar, en su lugar, |
1302 | 1302 | el archivo de extensiones del sistema |
1303 | | .IR @prefix@/share/mc/mc.ext . |
| 1303 | .IR @sysconfdir@/mc/mc.ext . |
1304 | 1304 | El formato del archivo (formato nuevo cambiado desde la versión 3.0) |
1305 | 1305 | es como sigue: |
1306 | 1306 | .PP |
… |
… |
el archivo .mc.menu del directorio actual, pero s |
1372 | 1372 | usuario o del superusuario y no es modificable por todos. |
1373 | 1373 | Si no se encuentra allí el archivo, se intenta de la misma manera con ~/.mc/menu, |
1374 | 1374 | y si no, mc utiliza el menú por defecto para todo el sistema |
1375 | | @prefix@/share/mc/mc.menu. |
| 1375 | @sysconfdir@/mc/mc.menu. |
1376 | 1376 | .PP |
1377 | 1377 | El formato del menú de archivo es muy simple. Todas las líneas, salvo |
1378 | 1378 | las que empiezan con espacio o tabulación, son consideradas entradas |
… |
… |
y puede ser impedida por alg |
1870 | 1870 | .SH " Guardar Configuración" |
1871 | 1871 | Al arrancar Midnight Commander se carga la información de inicio del |
1872 | 1872 | archivo ~/.mc/ini. Si éste no existe, se cargará la información del |
1873 | | archivo de configuración genérico del sistema, @prefix@/share/mc/mc.ini. |
| 1873 | archivo de configuración genérico del sistema, @sysconfdir@/mc/mc.ini. |
1874 | 1874 | Si el archivo de configuración genérico del sistema no existe, MC utiliza |
1875 | 1875 | la configuración por defecto. |
1876 | 1876 | .PP |
… |
… |
seleccionado en cada momento. |
3190 | 3190 | Midnight Commander permite hacer ajustes a la base de datos de terminales |
3191 | 3191 | del sistema sin necesidad de privilegios de superusuario. El programa |
3192 | 3192 | busca definiciones de teclas en el archivo de inicialización del sistema |
3193 | | .B @prefix@/share/mc/mc.lib |
| 3193 | .B @sysconfdir@/mc/mc.lib |
3194 | 3194 | o en el del usuario |
3195 | 3195 | .BR ~/.mc/ini , |
3196 | 3196 | en la sección "terminal:nuestro-terminal" y si no en "terminal:general". |
… |
… |
entorno MC_DATADIR, que de estar definida se emplear |
3244 | 3244 | .IP |
3245 | 3245 | Archivo de ayuda. |
3246 | 3246 | .PP |
3247 | | .I @prefix@/share/mc/mc.ext |
| 3247 | .I @sysconfdir@/mc/mc.ext |
3248 | 3248 | .IP |
3249 | 3249 | Archivo de extensiones por defecto del sistema. |
3250 | 3250 | .PP |
… |
… |
Archivo de extensiones por defecto del sistema. |
3253 | 3253 | Archivo de usuario de extensiones y configuración de visor y editor. Si |
3254 | 3254 | está presente prevalece sobre el contenido de los archivos del sistema. |
3255 | 3255 | .PP |
3256 | | .I @prefix@/share/mc/mc.ini |
| 3256 | .I @sysconfdir@/mc/mc.ini |
3257 | 3257 | .IP |
3258 | 3258 | Archivo de configuración del sistema para Midnight Commander, sólo si |
3259 | 3259 | el usuario no dispone de su propio ~/.mc/ini. |
3260 | 3260 | .PP |
3261 | | .I @prefix@/share/mc/mc.lib |
| 3261 | .I @sysconfdir@/mc/mc.lib |
3262 | 3262 | .IP |
3263 | 3263 | Opciones globales de Midnight Commander. Se aplican siempre a todos los |
3264 | 3264 | usuarios, tengan ~/.mc/ini o no. Actualmente sólo se emplea para los |
… |
… |
configuraci |
3277 | 3277 | Este archivo contiene los mensajes cortos de ayuda mostrados por el |
3278 | 3278 | programa. |
3279 | 3279 | .PP |
3280 | | .I @prefix@/share/mc/mc.menu |
| 3280 | .I @sysconfdir@/mc/mc.menu |
3281 | 3281 | .IP |
3282 | 3282 | Este archivo contiene el menú de aplicaciones por defecto para el sistema. |
3283 | 3283 | .PP |
-
diff --git a/doc/hu/mc.1.in b/doc/hu/mc.1.in
index 963c4f2..63250b6 100644
a
|
b
|
nem tal |
1357 | 1357 | .I ~/.mc/menu |
1358 | 1358 | keresése a következõ lépés, egyébként pedig az mc az alapértelmezett |
1359 | 1359 | rendszerszintû menüt használja, pl.: |
1360 | | .IR @prefix@/share/mc/mc.menu , |
1361 | | esetleg /etc/mc/mc.menu. |
| 1360 | .IR @sysconfdir@/mc/mc.menu , |
| 1361 | esetleg @sysconfdir@/mc/mc.menu. |
1362 | 1362 | .PP |
1363 | 1363 | A menü fájl formátuma nagyon egyszerû. A sorok, amelyek bármivel |
1364 | 1364 | kezdõdhetnek, de a space, vagy a tab megkülönböztetett menübejegyzések |
… |
… |
beolvasni az |
1865 | 1865 | .I ~/.mc/ini |
1866 | 1866 | fájlból. Ha ez a fájl nem létezik, ezeket az információkat a |
1867 | 1867 | rendszerszintû konfigurációs fájlból fogja beolvasni, amelyek a |
1868 | | .I @prefix@/share/mc/mc.ini |
| 1868 | .I @sysconfdir@/mc/mc.ini |
1869 | 1869 | fájlban találhatóak meg. Ha ez a rendszerszintû konfigurációs fájl sem |
1870 | 1870 | létezik, a MC az alapértelmezett beállításokat használja. |
1871 | 1871 | .PP |
… |
… |
fog |
3093 | 3093 | .IP |
3094 | 3094 | A program súgó fájlja. |
3095 | 3095 | .PP |
3096 | | .I @prefix@/share/mc/mc.ext |
| 3096 | .I @sysconfdir@/mc/mc.ext |
3097 | 3097 | .IP |
3098 | 3098 | Az alapértelmezett rendszerszintû kiterjesztés fájl. |
3099 | 3099 | .PP |
… |
… |
A felhaszn |
3103 | 3103 | beállítások. Ezek felülbírálják a rendszerszintû fájl bejegyzéseit, ha |
3104 | 3104 | van ilyen. |
3105 | 3105 | .PP |
3106 | | .I @prefix@/share/mc/mc.ini |
| 3106 | .I @sysconfdir@/mc/mc.ini |
3107 | 3107 | .IP |
3108 | 3108 | Az alapértelmezett rendszerszintû Midnight Commander beállítás, amelyet |
3109 | 3109 | csak akkor használ, ha a felhasználónak nincs saját ~/.mc/ini fájlja. |
3110 | 3110 | .PP |
3111 | | .I @prefix@/share/mc/mc.lib |
| 3111 | .I @sysconfdir@/mc/mc.lib |
3112 | 3112 | .IP |
3113 | 3113 | A Midnight Commander globális beállításai. Az ebben a fájlban elvégzett |
3114 | 3114 | beállítások minden felhasználó Midnight Commander-jére vonatkoznak, ez |
… |
… |
helyett. |
3125 | 3125 | Ez a fájl tartalmazza a program által megjelenített útmutattásokat |
3126 | 3126 | (cookie-kat). |
3127 | 3127 | .PP |
3128 | | .I @prefix@/share/mc/mc.menu |
| 3128 | .I @sysconfdir@/mc/mc.menu |
3129 | 3129 | .IP |
3130 | 3130 | Ez a fájl azonos a rendszerszintû alkalmazás menüvel. |
3131 | 3131 | .PP |
-
diff --git a/doc/it/mc.1.in b/doc/it/mc.1.in
index af61b19..e89c510 100644
a
|
b
|
utilizzato, se esiste, il file .mc.menu dalla directory corrente, |
1365 | 1365 | ma solo se è di proprietà dell'utente o di root e se non è scrivibile |
1366 | 1366 | a tutti. Se tale file non viene trovato, mc alla stessa maniera |
1367 | 1367 | prova con ~/.mc/menu altrimenti usa il menu di sistema |
1368 | | @prefix@/share/mc/mc.menu. |
| 1368 | @sysconfdir@/mc/mc.menu. |
1369 | 1369 | .PP |
1370 | 1370 | Il formato del file menu è molto semplice. Le righe che cominciano |
1371 | 1371 | con qualsiasi cosa che non sia uno spazio o una tabulazione sono |
… |
… |
funzionare con alcuni firewall. |
1899 | 1899 | Alla partenza il Midnight Commander prova a caricare le informazioni di |
1900 | 1900 | inizializzazione dal file ~/.mc/ini. Se questo file non esiste, |
1901 | 1901 | caricherà le informazioni dal file di configurazione di sistema |
1902 | | posizionato in @prefix@/share/mc/mc.ini. Se il file di configurazione di |
| 1902 | posizionato in @sysconfdir@/mc/mc.ini. Se il file di configurazione di |
1903 | 1903 | sistema non esiste, MC userà le impostazioni predefinite. |
1904 | 1904 | .PP |
1905 | 1905 | Il comando |
… |
… |
passer |
3117 | 3117 | .IP |
3118 | 3118 | Il file di aiuto per il programma. |
3119 | 3119 | .PP |
3120 | | .I @prefix@/share/mc/mc.ext |
| 3120 | .I @sysconfdir@/mc/mc.ext |
3121 | 3121 | .IP |
3122 | 3122 | Il file delle estensioni di sistema predefinito. |
3123 | 3123 | .PP |
… |
… |
Le estensioni dell'utente, la configurazione del visualizzatore e |
3127 | 3127 | dell'editor di file. Se presenti, questi file si sovrappongono ai file di |
3128 | 3128 | sistema. |
3129 | 3129 | .PP |
3130 | | .I @prefix@/share/mc/mc.ini |
| 3130 | .I @sysconfdir@/mc/mc.ini |
3131 | 3131 | .IP |
3132 | 3132 | La configurazione di sistema predefinita per il Midnight Commander, usata solo |
3133 | 3133 | se l'utente non possiede il proprio file ~/.mc/ini. |
3134 | 3134 | .PP |
3135 | | .I @prefix@/share/mc/mc.lib |
| 3135 | .I @sysconfdir@/mc/mc.lib |
3136 | 3136 | .IP |
3137 | 3137 | Le impostazioni globali per il Midnight Commander. La modifica di questo |
3138 | 3138 | file influisce su tutti gli utenti, che abbiano o no il file ~/.mc/ini . |
… |
… |
viene caricata da qui invece che dal file di sistema. |
3151 | 3151 | .IP |
3152 | 3152 | Questo file contiene i suggerimenti (dritte) mostrate dal programma. |
3153 | 3153 | .PP |
3154 | | .I @prefix@/share/mc/mc.menu |
| 3154 | .I @sysconfdir@/mc/mc.menu |
3155 | 3155 | .IP |
3156 | 3156 | Questo file contiene il menu di sistema per le applicazioni. |
3157 | 3157 | .PP |
-
diff --git a/doc/mc.1.in b/doc/mc.1.in
index e29d169..a8c1d73 100644
a
|
b
|
file .mc.menu from the current directory is used if it exists, |
1396 | 1396 | but only if it is owned by user or root and is not world-writable. |
1397 | 1397 | If no such file found, ~/.mc/menu is tried in the same way, |
1398 | 1398 | and otherwise mc uses the default system-wide menu |
1399 | | @prefix@/share/mc/mc.menu. |
| 1399 | @sysconfdir@/mc/mc.menu. |
1400 | 1400 | .PP |
1401 | 1401 | The format of the menu file is very simple. Lines that start with |
1402 | 1402 | anything but space or tab are considered entries for the menu (in |
… |
… |
firewalls. |
1923 | 1923 | At startup the Midnight Commander will try to load initialization |
1924 | 1924 | information from the ~/.mc/ini file. If this file doesn't exist, it will |
1925 | 1925 | load the information from the system-wide configuration file, located in |
1926 | | @prefix@/share/mc/mc.ini. If the system-wide configuration file doesn't |
| 1926 | @sysconfdir@/mc/mc.ini. If the system-wide configuration file doesn't |
1927 | 1927 | exist, MC uses the default settings. |
1928 | 1928 | .PP |
1929 | 1929 | The |
… |
… |
instead of @prefix@/share/mc in the paths below. |
3251 | 3251 | .IP |
3252 | 3252 | The help file for the program. |
3253 | 3253 | .PP |
3254 | | .I @prefix@/share/mc/mc.ext |
| 3254 | .I @sysconfdir@/mc/mc.ext |
3255 | 3255 | .IP |
3256 | 3256 | The default system-wide extensions file. |
3257 | 3257 | .PP |
… |
… |
The default system-wide extensions file. |
3260 | 3260 | User's own extension, view configuration and edit configuration |
3261 | 3261 | file. They override the contents of the system wide files if present. |
3262 | 3262 | .PP |
3263 | | .I @prefix@/share/mc/mc.ini |
| 3263 | .I @sysconfdir@/mc/mc.ini |
3264 | 3264 | .IP |
3265 | 3265 | The default system-wide setup for the Midnight Commander, used only if |
3266 | 3266 | the user doesn't have his own ~/.mc/ini file. |
3267 | 3267 | .PP |
3268 | | .I @prefix@/share/mc/mc.lib |
| 3268 | .I @sysconfdir@/mc/mc.lib |
3269 | 3269 | .IP |
3270 | 3270 | Global settings for the Midnight Commander. Settings in this file |
3271 | 3271 | affect all users, whether they have ~/.mc/ini or not. Currently, only |
… |
… |
from here instead of the system-wide startup file. |
3283 | 3283 | .IP |
3284 | 3284 | This file contains the hints displayed by the program. |
3285 | 3285 | .PP |
3286 | | .I @prefix@/share/mc/mc.menu |
| 3286 | .I @sysconfdir@/mc/mc.menu |
3287 | 3287 | .IP |
3288 | 3288 | This file contains the default system-wide applications menu. |
3289 | 3289 | .PP |
-
diff --git a/doc/mcedit.1.in b/doc/mcedit.1.in
index 691d86e..9490c4f 100644
a
|
b
|
clean. |
467 | 467 | .IP |
468 | 468 | The help file for the program. |
469 | 469 | .PP |
470 | | .I @prefix@/share/mc/mc.ini |
| 470 | .I @sysconfdir@/mc/mc.ini |
471 | 471 | .IP |
472 | 472 | The default system-wide setup for GNU Midnight Commander, used only if |
473 | 473 | the user's own ~/.mc/ini file is missing. |
474 | 474 | .PP |
475 | | .I @prefix@/share/mc/mc.lib |
| 475 | .I @sysconfdir@/mc/mc.lib |
476 | 476 | .IP |
477 | 477 | Global settings for the Midnight Commander. Settings in this file |
478 | 478 | affect all users, whether they have ~/.mc/ini or not. |
-
diff --git a/doc/mcview.1.in b/doc/mcview.1.in
index 327dbf1..f9257b1 100644
a
|
b
|
selected=black,green" |
65 | 65 | .IP |
66 | 66 | The help file for the program. |
67 | 67 | .PP |
68 | | .I @prefix@/share/mc/mc.ini |
| 68 | .I @sysconfdir@/mc/mc.ini |
69 | 69 | .IP |
70 | 70 | The default system-wide setup for GNU Midnight Commander, used only if |
71 | 71 | the user's own ~/.mc/ini file is missing. |
72 | 72 | .PP |
73 | | .I @prefix@/share/mc/mc.lib |
| 73 | .I @sysconfdir@/mc/mc.lib |
74 | 74 | .IP |
75 | 75 | Global settings for the Midnight Commander. Settings in this file |
76 | 76 | affect all users, whether they have ~/.mc/ini or not. |
-
diff --git a/doc/pl/mc.1.in b/doc/pl/mc.1.in
index 910e661..4658763 100644
a
|
b
|
przy u |
1152 | 1152 | tylko wtedy kiedy jest on w posiadaniu u¿ytkownika lub roota i mamy do niego |
1153 | 1153 | prawa zapisu. Je¶li takiego nie ma próbuje siê z plikiem ~/.mc/menu z tymi |
1154 | 1154 | samymi za³o¿eniami, je¶li jego te¿ nie ma - u¿ywa siê standardowego pliku |
1155 | | systemowego, który znajduje siê w @prefix@/share/mc/mc.menu. |
| 1155 | systemowego, który znajduje siê w @sysconfdir@/mc/mc.menu. |
1156 | 1156 | .PP |
1157 | 1157 | Format pliku z menu u¿ytkownika jest bardzo prosty. Linie zaczynaj±ce siê |
1158 | 1158 | od czegokolwiek innego ni¿ spacja lub tabulacja, s± traktowane jako |
… |
… |
System plik |
1590 | 1590 | .SH " Zapisz ustawienia (Save Setup)" |
1591 | 1591 | Na starcie Midnight Commander bêdzie próbowa³ odczytaæ opcje startowe |
1592 | 1592 | z pliku ~/.mc/ini. Je¶li on nie istnieje, odczyta on konfiguracje z |
1593 | | ogólnodostêpnego pliku @prefix@/share/mc/mc.ini. Je¶li on te¿ nie istnieje MC |
| 1593 | ogólnodostêpnego pliku @sysconfdir@/mc/mc.ini. Je¶li on te¿ nie istnieje MC |
1594 | 1594 | u¿yje swoich domy¶lnych ustawieñ. |
1595 | 1595 | .PP |
1596 | 1596 | Komenda |
… |
… |
je |
2793 | 2793 | .IP |
2794 | 2794 | Plik pomocy dla programu. |
2795 | 2795 | .PP |
2796 | | @prefix@/share/mc/mc.ext |
| 2796 | @sysconfdir@/mc/mc.ext |
2797 | 2797 | .IP |
2798 | 2798 | Standardowy plik rozszerzeñ plików. |
2799 | 2799 | .PP |
… |
… |
Standardowy plik rozszerze |
2802 | 2802 | W³asny plik u¿ytkownika, konfiguruje podgl±d i edycje plików. Ma wy¿szy |
2803 | 2803 | priorytet ni¿ plik systemowy. |
2804 | 2804 | .PP |
2805 | | @prefix@/share/mc/mc.ini |
| 2805 | @sysconfdir@/mc/mc.ini |
2806 | 2806 | .IP |
2807 | 2807 | Standardowy plik setupu do Midnight Commandera, u¿ywany tylko wówczas, |
2808 | 2808 | kiedy u¿ytkownik nie ma swojego w³asnego pliku ~/.mc/ini. |
2809 | 2809 | .PP |
2810 | | @prefix@/share/mc/mc.lib |
| 2810 | @sysconfdir@/mc/mc.lib |
2811 | 2811 | .IP |
2812 | 2812 | Globalne ustawienia Midnight Commandera. Ustawienia w tym pliku s± |
2813 | 2813 | uwzglêdniane przez wszystkie sesje Midnight Commandera, u¿yteczne do |
… |
… |
zamiast pliku globalnego. |
2822 | 2822 | .IP |
2823 | 2823 | Plik zawieraj±cy podpowiedzi (hints) wy¶wietlane przez program. |
2824 | 2824 | .PP |
2825 | | @prefix@/share/mc/mc.menu |
| 2825 | @sysconfdir@/mc/mc.menu |
2826 | 2826 | .IP |
2827 | 2827 | Ten plik zawiera informacje o ogólnosystemowych aplikacjach w menu. |
2828 | 2828 | .PP |
-
diff --git a/doc/ru/mc.1.in b/doc/ru/mc.1.in
index a74d61f..3909491 100644
a
|
b
|
View |
1532 | 1532 | ÏÂÒÁÚÏÍ ÉÝÅÔÓÑ ÆÁÊÌ |
1533 | 1533 | .B ~/.mc/menu |
1534 | 1534 | É, × ÐÏÓÌÅÄÎÀÀ ÏÞÅÒÅÄØ, mc ÉÓÐÏÌØÚÕÅÔ ÏÂÝÅÓÉÓÔÅÍÎÏÅ ÍÅÎÀ |
1535 | | .BR @prefix@/share/mc/mc.menu . |
| 1535 | .BR @sysconfdir@/mc/mc.menu . |
1536 | 1536 | .PP |
1537 | 1537 | æÏÒÍÁÔ ×ÓÅÈ ÔÒÅÈ ÆÁÊÌÏ× ÍÅÎÀ ÏÄÉÎÁËÏ× É ÏÞÅÎØ ÐÒÏÓÔ. óÔÒÏËÉ ËÏÍÍÅÎÔÁÒÉÅ× |
1538 | 1538 | ÎÁÞÉÎÁÀÔÓÑ Ó '#'. äÏÐÏÌÎÉÔÅÌØÎÙÅ ËÏÍÍÅÎÔÁÒÉÉ ÄÏÌÖÎÙ ÎÁÞÉÎÁÔØÓÑ Ó '#', |
… |
… |
insert=\\e[Op |
3637 | 3637 | .IP |
3638 | 3638 | æÁÊÌ ÐÏÄÓËÁÚËÉ ÄÌÑ ÐÒÏÇÒÁÍÍÙ. |
3639 | 3639 | .PP |
3640 | | .I @prefix@/share/mc/mc.ext |
| 3640 | .I @sysconfdir@/mc/mc.ext |
3641 | 3641 | .IP |
3642 | 3642 | éÓÐÏÌØÚÕÅÍÙÊ ÐÏ ÕÍÏÌÞÁÎÉÀ ÏÂÝÅÓÉÓÔÅÍÎÙÊ ÆÁÊÌ ÒÁÓÛÉÒÅÎÉÊ. |
3643 | 3643 | .PP |
… |
… |
insert=\\e[Op |
3646 | 3646 | æÁÊÌ ÒÁÓÛÉÒÅÎÉÊ ÐÏÌØÚÏ×ÁÔÅÌÑ. åÓÌÉ ÜÔÏÔ ÆÁÊÌ ÓÕÝÅÓÔ×ÕÅÔ, ÏÎ ÉÓÐÏÌØÚÕÅÔÓÑ |
3647 | 3647 | ×ÍÅÓÔÏ ÏÂÝÅÓÉÓÔÅÍÎÏÇÏ ÆÁÊÌÁ ÒÁÓÛÉÒÅÎÉÊ. |
3648 | 3648 | .PP |
3649 | | .I @prefix@/share/mc/mc.ini |
| 3649 | .I @sysconfdir@/mc/mc.ini |
3650 | 3650 | .IP |
3651 | 3651 | éÓÐÏÌØÚÕÅÍÙÊ ÐÏ ÕÍÏÌÞÁÎÉÀ ÏÂÝÅÓÉÓÔÅÍÎÙÊ ÆÁÊÌ ÕÓÔÁÎÏ×ÏË ÄÌÑ Midnight |
3652 | 3652 | Commander; ÉÓÐÏÌØÚÕÅÔÓÑ ÔÏÌØËÏ × ÔÅÈ ÓÌÕÞÁÑÈ, ËÏÇÄÁ ÐÏÌØÚÏ×ÁÔÅÌØ ÎÅ |
3653 | 3653 | ÉÍÅÅÔ Ó×ÏÅÇÏ ÆÁÊÌÁ |
3654 | 3654 | .B ~/.mc/ini |
3655 | 3655 | .PP |
3656 | | .I @prefix@/share/mc/mc.lib |
| 3656 | .I @sysconfdir@/mc/mc.lib |
3657 | 3657 | .IP |
3658 | 3658 | çÌÏÂÁÌØÎÙÅ ÕÓÔÁÎÏ×ËÉ ÄÌÑ Midnight Commander. õÓÔÁÎÏ×ËÉ ÉÚ ÜÔÏÇÏ ÆÁÊÌÁ |
3659 | 3659 | ÄÅÊÓÔ×ÉÔÅÌØÎÙ ÄÌÑ ×ÓÅÈ ÐÏÌØÚÏ×ÁÔÅÌÅÊ, ÎÅÚÁ×ÉÓÉÍÏ ÏÔ ÔÏÇÏ, ÉÍÅÀÔ ÌÉ ÏÎÉ |
… |
… |
Commander; |
3674 | 3674 | üÔÏÔ ÆÁÊÌ ÓÏÄÅÒÖÉÔ ÐÏÄÓËÁÚËÉ (hints ÉÌÉ cookies), ÃÉËÌÉÞÅÓËÉ |
3675 | 3675 | ÏÔÏÂÒÁÖÁÅÍÙÅ ÐÒÏÇÒÁÍÍÏÊ. |
3676 | 3676 | .PP |
3677 | | .I @prefix@/share/mc/mc.menu |
| 3677 | .I @sysconfdir@/mc/mc.menu |
3678 | 3678 | .IP |
3679 | 3679 | üÔÏÔ ÆÁÊÌ ÓÏÄÅÒÖÉÔ ÏÂÝÅÓÉÓÔÅÍÎÏÅ ÍÅÎÀ ÐÒÉÌÏÖÅÎÉÊ. |
3680 | 3680 | .PP |
-
diff --git a/doc/sr/mc.1.in b/doc/sr/mc.1.in
index 84c1aa2..0f5617a 100644
a
|
b
|
awk '$9 ~! /incoming/ { print $9 }' < /usr/adm/xferlog |
1358 | 1358 | ÔÞ×ÒÞùÕÝ ãßØá ã úã ÞÔ áâàÐÝÕ ÔàãÓØå (áÒÕâÐ). °ÚÞ âÐÚÒÐ ÔÐâÞâÕÚÐ ÝØøÕ |
1359 | 1359 | ÝÐòÕÝÐ, ÝÐ ØáâØ ÝÐçØÝ áÕ ßÞÚãèÐÒÐ áÐ ÔÐâÞâÕÚÞÜ ~/.mc/menu, Ð ØÝÐçÕ ¿½ |
1360 | 1360 | ÚÞàØáâØ ßÞÔàÐ×ãÜÕÒÐÝã ÔÐâÞâÕÚã ÜÕÝØøÐ ×Ð æÕÞ áØáâÕÜ |
1361 | | @prefix@/share/mc/mc.menu. |
| 1361 | @sysconfdir@/mc/mc.menu. |
1362 | 1362 | .PP |
1363 | 1363 | ÄÞàÜÐâ ÔÐâÞâÕÚÕ ÜÕÝØøÐ øÕ ÒÕÞÜÐ øÕÔÝÞáâÐÒÐÝ. ÀÕÔÞÒØ ÚÞøØ ßÞçØúã ÑØÛÞ |
1364 | 1364 | çØÜ ÞáØÜ àÐ×ÜÐÚÐ ØÛØ âÐÑãÛÐâÞàÐ áÕ ã×ØÜÐøã ×Ð áâÐÒÚÕ ÜÕÝØøÐ (ÔÐ ÑØ áÕ |
… |
… |
MC_DATADIR. |
3247 | 3247 | .IP |
3248 | 3248 | ´ÐâÞâÕÚÐ ßÞÜÞûØ ×Ð ßàÞÓàÐÜ. |
3249 | 3249 | .PP |
3250 | | .I @prefix@/share/mc/mc.ext |
| 3250 | .I @sysconfdir@/mc/mc.ext |
3251 | 3251 | .IP |
3252 | 3252 | ¿ÞÔàÐ×ãÜÕÒÐÝÐ áØáâÕÜáÚÐ ÔÐâÞâÕÚÐ ÒàáâÐ. |
3253 | 3253 | .PP |
… |
… |
MC_DATADIR. |
3256 | 3256 | ºÞàØáÝØçÚÕ ÔÐâÞâÕÚÕ ÒàáâÐ, ßÞÔÕèÐÒÐúÐ ßàÕÓÛÕÔÐçÐ Ø ãàÕòØÒÐçÐ. ÃÚÞÛØÚÞ |
3257 | 3257 | ßÞáâÞøÕ, ÞÝÕ ×ÐÞÑØÛÐ×Õ áØáâÕÜáÚÕ ÔÐâÞâÕÚÕ. |
3258 | 3258 | .PP |
3259 | | .I @prefix@/share/mc/mc.ini |
| 3259 | .I @sysconfdir@/mc/mc.ini |
3260 | 3260 | .IP |
3261 | 3261 | ¿ÞÔàÐ×ãÜÕÒÐÝÐ áØáâÕÜáÚÐ ßÞÔÕèÐÒÐúÐ ¿ÞÝÞûÝÞÓ ÝÐàÕÔÝØÚÐ; ÚÞàØáâÕ áÕ áÐÜÞ |
3262 | 3262 | ã áÛãçÐøã ÔÐ ÚÞàØáÝØÚ ÝÕÜÐ áÞßáâÒÕÝã ÔÐâÞâÕÚã ~/.mc/ini. |
3263 | 3263 | .PP |
3264 | | .I @prefix@/share/mc/mc.lib |
| 3264 | .I @sysconfdir@/mc/mc.lib |
3265 | 3265 | .IP |
3266 | 3266 | ³ÛÞÑÐÛÝÕ ßÞáâÐÒÚÕ ¿ÞÝÞûÝÞÓ ÝÐàÕÔÝØÚÐ. ¿ÞáâÐÒÚÕ Ø× ÞÒÕ ÔÐâÞâÕÚÕ áÕ |
3267 | 3267 | ÞÔÝÞáÕ ÝÐ áÒÕ ÚÞàØáÝØÚÕ ÑÕ× ÞÑ×ØàÐ ÝÐ âÞ ÔÐ ÛØ ÞÝØ ØÜÐøã áÒÞøÕ |
… |
… |
MC_DATADIR. |
3280 | 3280 | .IP |
3281 | 3281 | ¾ÒÐ ÔÐâÞâÕÚÐ áÐÔàÖØ áÐÒÕâÕ (ÚÞÛÐçØûÕ) ÚÞøØ áÕ ßàØÚÐ×ãøã ã ßàÞÓàÐÜã. |
3282 | 3282 | .PP |
3283 | | .I @prefix@/share/mc/mc.menu |
| 3283 | .I @sysconfdir@/mc/mc.menu |
3284 | 3284 | .IP |
3285 | 3285 | ¾ÒÐ ÔÐâÞâÕÚÐ áÐÔàÖØ ßÞÔàÐ×ãÜÕÒÐÝØ ÜÕÝØ ßàÞÓàÐÜÐ ×Ð æÕÞ áØáâÕÜ. |
3286 | 3286 | .PP |
-
diff --git a/edit/edit.h b/edit/edit.h
index d7725b6..5b4fdd4 100644
a
|
b
|
extern int column_highlighting; |
300 | 300 | |
301 | 301 | /* File names */ |
302 | 302 | #define EDIT_DIR ".mc" PATH_SEP_STR "cedit" |
303 | | #define SYNTAX_FILE EDIT_DIR PATH_SEP_STR "Syntax" |
304 | 303 | #define CLIP_FILE EDIT_DIR PATH_SEP_STR "cooledit.clip" |
305 | 304 | #define MACRO_FILE EDIT_DIR PATH_SEP_STR "cooledit.macros" |
306 | 305 | #define BLOCK_FILE EDIT_DIR PATH_SEP_STR "cooledit.block" |
-
diff --git a/edit/editcmd.c b/edit/editcmd.c
index 01262f1..4838230 100644
a
|
b
|
|
50 | 50 | #include "../src/tty.h" /* LINES */ |
51 | 51 | #include "../src/widget.h" /* listbox_new() */ |
52 | 52 | #include "../src/layout.h" /* clr_scr() */ |
53 | | #include "../src/main.h" /* mc_home */ |
54 | 53 | #include "../src/help.h" /* interactive_display() */ |
55 | 54 | #include "../src/key.h" /* XCTRL */ |
56 | 55 | #include "../src/dialog.h" /* do_refresh() */ |
57 | 56 | #include "../src/wtools.h" /* message() */ |
58 | 57 | #include "../src/charsets.h" |
59 | 58 | #include "../src/selcodepage.h" |
| 59 | #include "../src/mc_conf.h" /* MC global configuration */ |
60 | 60 | |
61 | 61 | #define edit_get_load_file(f,h) input_expand_dialog (h, _(" Enter file name: "), f) |
62 | 62 | #define edit_get_save_file(f,h) input_expand_dialog (h, _(" Enter file name: "), f) |
… |
… |
edit_block_process_cmd (WEdit *edit, const char *shell_cmd, int block) |
2517 | 2517 | const char *b = NULL; |
2518 | 2518 | char *quoted_name = NULL; |
2519 | 2519 | |
2520 | | o = catstrs (mc_home, shell_cmd, (char *) NULL); /* original source script */ |
| 2520 | o = catstrs (mc_global_datadir, shell_cmd, (char *) NULL); /* original source script */ |
2521 | 2521 | h = catstrs (home_dir, PATH_SEP_STR EDIT_DIR, shell_cmd, (char *) NULL); /* home script */ |
2522 | 2522 | b = catstrs (home_dir, PATH_SEP_STR BLOCK_FILE, (char *) NULL); /* block file */ |
2523 | 2523 | |
-
diff --git a/edit/syntax.c b/edit/syntax.c
index 23e8b6c..e5504e3 100644
a
|
b
|
|
38 | 38 | #include "edit.h" |
39 | 39 | #include "edit-widget.h" |
40 | 40 | #include "../src/color.h" /* use_colors */ |
41 | | #include "../src/main.h" /* mc_home */ |
42 | 41 | #include "../src/wtools.h" /* message() */ |
| 42 | #include "../src/mc_conf.h" /* MC global configuration */ |
43 | 43 | |
44 | 44 | /* bytes */ |
45 | 45 | #define SYNTAX_MARKER_DENSITY 512 |
… |
… |
char *option_syntax_type = NULL; |
104 | 104 | |
105 | 105 | #define syntax_g_free(x) do {g_free(x); (x)=0;} while (0) |
106 | 106 | |
| 107 | #define _syntaxfile(fn) (_strcatdup(mc_global_syntaxdir, fn)) |
| 108 | |
107 | 109 | static gint |
108 | 110 | mc_defines_destroy (gpointer key, gpointer value, gpointer data) |
109 | 111 | { |
… |
… |
this_try_alloc_color_pair (const char *fg, const char *bg) |
662 | 664 | |
663 | 665 | static char *error_file_name = 0; |
664 | 666 | |
| 667 | /* the the filename of last error occourence */ |
| 668 | static inline void _set_err_fn(const char* filename) |
| 669 | { |
| 670 | if (error_file_name) |
| 671 | free(error_file_name); |
| 672 | error_file_name = g_strdup(filename); |
| 673 | } |
| 674 | |
665 | 675 | static FILE *open_include_file (const char *filename) |
666 | 676 | { |
667 | 677 | FILE *f; |
… |
… |
static FILE *open_include_file (const char *filename) |
679 | 689 | return f; |
680 | 690 | |
681 | 691 | g_free (error_file_name); |
682 | | error_file_name = g_strconcat (mc_home, PATH_SEP_STR "syntax" PATH_SEP_STR, |
683 | | filename, (char *) NULL); |
| 692 | error_file_name = _syntaxfile(filename); |
| 693 | |
684 | 694 | return fopen (error_file_name, "r"); |
685 | 695 | } |
686 | 696 | |
… |
… |
edit_read_syntax_file (WEdit * edit, char ***pnames, const char *syntax_file, |
1026 | 1036 | |
1027 | 1037 | f = fopen (syntax_file, "r"); |
1028 | 1038 | if (!f){ |
1029 | | lib_file = concat_dir_and_file (mc_home, "syntax" PATH_SEP_STR "Syntax"); |
| 1039 | lib_file = _syntaxfile("Syntax"); |
1030 | 1040 | f = fopen (lib_file, "r"); |
1031 | 1041 | g_free (lib_file); |
1032 | 1042 | if (!f) |
… |
… |
void |
1169 | 1179 | edit_load_syntax (WEdit *edit, char ***pnames, const char *type) |
1170 | 1180 | { |
1171 | 1181 | int r; |
1172 | | char *f = NULL; |
1173 | 1182 | |
1174 | 1183 | if (option_auto_syntax) |
1175 | 1184 | type = NULL; |
… |
… |
edit_load_syntax (WEdit *edit, char ***pnames, const char *type) |
1188 | 1197 | if (!*edit->filename && !type) |
1189 | 1198 | return; |
1190 | 1199 | } |
1191 | | f = concat_dir_and_file (home_dir, SYNTAX_FILE); |
1192 | | r = edit_read_syntax_file (edit, pnames, f, edit ? edit->filename : 0, |
| 1200 | r = edit_read_syntax_file (edit, pnames, mc_user_syntaxfile, edit ? edit->filename : 0, |
1193 | 1201 | get_first_editor_line (edit), type); |
1194 | 1202 | if (r == -1) { |
1195 | 1203 | edit_free_syntax_rules (edit); |
1196 | 1204 | message (D_ERROR, _(" Load syntax file "), |
1197 | | _(" Cannot open file %s \n %s "), f, |
| 1205 | _(" Cannot open file %s \n %s "), mc_user_syntaxfile, |
1198 | 1206 | unix_error_string (errno)); |
1199 | 1207 | } else if (r) { |
1200 | 1208 | edit_free_syntax_rules (edit); |
1201 | 1209 | message (D_ERROR, _(" Load syntax file "), |
1202 | 1210 | _(" Error in file %s on line %d "), |
1203 | | error_file_name ? error_file_name : f, r); |
| 1211 | error_file_name ? error_file_name : mc_user_syntaxfile, r); |
1204 | 1212 | syntax_g_free (error_file_name); |
1205 | 1213 | } else { |
1206 | 1214 | /* succeeded */ |
1207 | 1215 | } |
1208 | | g_free (f); |
1209 | 1216 | } |
-
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 5f61432..1c5457b 100644
a
|
b
|
|
1 | 1 | suppbindir = $(pkgdatadir)/bin |
| 2 | mcconfdir = $(sysconfdir)/mc |
2 | 3 | |
3 | 4 | if CHARSET |
4 | 5 | LIBFILES_ADD = mc.charsets |
… |
… |
else |
6 | 7 | LIBFILES_ADD = |
7 | 8 | endif |
8 | 9 | |
9 | | LIBFILES_OUT = mc.ext |
10 | 10 | LIBFILES_CONST = mc.hint mc.hint.cs mc.hint.es mc.hint.hu mc.hint.it \ |
11 | 11 | mc.hint.nl mc.hint.pl mc.hint.ru mc.hint.sr mc.hint.uk \ |
12 | | mc.hint.zh mc.lib mc.menu mc.menu.sr cedit.menu edit.indent.rc \ |
13 | | edit.spell.rc |
| 12 | mc.hint.zh edit.indent.rc edit.spell.rc |
14 | 13 | |
15 | 14 | noinst_DATA = README.xterm mcserv.init mcserv.pamd xterm.ad |
16 | 15 | |
… |
… |
SCRIPTS_OUT = mc.csh mc.sh mc-wrapper.csh mc-wrapper.sh |
19 | 18 | |
20 | 19 | suppbin_SCRIPTS = $(SCRIPTS_OUT) |
21 | 20 | |
22 | | pkgdata_DATA = $(LIBFILES_CONST) $(LIBFILES_ADD) $(LIBFILES_OUT) |
| 21 | pkgdata_DATA = $(LIBFILES_CONST) $(LIBFILES_ADD) |
| 22 | mcconf_DATA = mc.ext cedit.menu mc.menu mc.menu.sr mc.lib |
23 | 23 | |
24 | 24 | CLEANFILES = $(SCRIPTS_OUT) |
25 | 25 | |
-
diff --git a/mc.qpg.in b/mc.qpg.in
index 24f8983..d75f9ad 100644
a
|
b
|
|
32 | 32 | <QPG:Add file="./lib/mc-wrapper.sh" permissions="0755" install="/opt/share/mc/bin/"/> |
33 | 33 | <QPG:Add file="./lib/mc.csh" permissions="0755" install="/opt/share/mc/bin/"/> |
34 | 34 | <QPG:Add file="./lib/mc.sh" permissions="0755" install="/opt/share/mc/bin/"/> |
35 | | <QPG:Add file="./lib/cedit.menu" permissions="0644" install="/opt/share/mc/"/> |
| 35 | <QPG:Add file="./lib/cedit.menu" permissions="0644" install="/etc/mc/"/> |
36 | 36 | <QPG:Add file="./lib/edit.indent.rc" permissions="0644" install="/opt/share/mc/"/> |
37 | 37 | <QPG:Add file="./lib/edit.spell.rc" permissions="0644" install="/opt/share/mc/"/> |
38 | 38 | <QPG:Add file="./vfs/extfs/README" permissions="0644" install="/opt/share/mc/extfs/"/> |
… |
… |
|
44 | 44 | <QPG:Add file="./vfs/extfs/deba" permissions="0755" install="/opt/share/mc/extfs/"/> |
45 | 45 | <QPG:Add file="./vfs/extfs/debd" permissions="0755" install="/opt/share/mc/extfs/"/> |
46 | 46 | <QPG:Add file="./vfs/extfs/dpkg" permissions="0755" install="/opt/share/mc/extfs/"/> |
47 | | <QPG:Add file="./vfs/extfs/extfs.ini" permissions="0644" install="/opt/share/mc/extfs/"/> |
| 47 | <QPG:Add file="./vfs/extfs/extfs.ini" permissions="0644" install="/etc/mc/"/> |
48 | 48 | <QPG:Add file="./vfs/extfs/hp48" permissions="0755" install="/opt/share/mc/extfs/"/> |
49 | 49 | <QPG:Add file="./vfs/extfs/iso9660" permissions="0755" install="/opt/share/mc/extfs/"/> |
50 | 50 | <QPG:Add file="./vfs/extfs/lslR" permissions="0755" install="/opt/share/mc/extfs/"/> |
… |
… |
|
52 | 52 | <QPG:Add file="./vfs/extfs/patchfs" permissions="0755" install="/opt/share/mc/extfs/"/> |
53 | 53 | <QPG:Add file="./vfs/extfs/rpm" permissions="0755" install="/opt/share/mc/extfs/"/> |
54 | 54 | <QPG:Add file="./vfs/extfs/rpms" permissions="0755" install="/opt/share/mc/extfs/"/> |
55 | | <QPG:Add file="./vfs/extfs/sfs.ini" permissions="0755" install="/opt/share/mc/extfs/"/> |
| 55 | <QPG:Add file="./vfs/extfs/sfs.ini" permissions="0755" install="/etc/mc/"/> |
56 | 56 | <QPG:Add file="./vfs/extfs/trpm" permissions="0755" install="/opt/share/mc/extfs/"/> |
57 | 57 | <QPG:Add file="./vfs/extfs/uar" permissions="0755" install="/opt/share/mc/extfs/"/> |
58 | 58 | <QPG:Add file="./vfs/extfs/uarj" permissions="0755" install="/opt/share/mc/extfs/"/> |
… |
… |
|
81 | 81 | <QPG:Add file="./doc/pl/mc.hlp.pl" permissions="0644" install="/opt/share/mc/"/> |
82 | 82 | <QPG:Add file="./doc/ru/mc.hlp.ru" permissions="0644" install="/opt/share/mc/"/> |
83 | 83 | <QPG:Add file="./doc/sr/mc.hlp.sr" permissions="0644" install="/opt/share/mc/"/> |
84 | | <QPG:Add file="./lib/mc.lib" permissions="0644" install="/opt/share/mc/"/> |
85 | | <QPG:Add file="./lib/mc.menu" permissions="0644" install="/opt/share/mc/"/> |
86 | | <QPG:Add file="./lib/mc.menu.sr" permissions="0644" install="/opt/share/mc/"/> |
| 84 | <QPG:Add file="./lib/mc.lib" permissions="0644" install="/etc/mc/"/> |
| 85 | <QPG:Add file="./lib/mc.menu" permissions="0644" install="/etc/mc/"/> |
| 86 | <QPG:Add file="./lib/mc.menu.sr" permissions="0644" install="/etc/mc/"/> |
87 | 87 | <QPG:Add file="./syntax/Syntax" permissions="0644" install="/opt/share/mc/syntax/"/> |
88 | 88 | <QPG:Add file="./syntax/ada95.syntax" permissions="0644" install="/opt/share/mc/syntax/"/> |
89 | 89 | <QPG:Add file="./syntax/aspx.syntax" permissions="0644" install="/opt/share/mc/syntax/"/> |
-
diff --git a/mc.spec.in b/mc.spec.in
index 2ce44bc..ba730df 100644
a
|
b
|
rm -rf $RPM_BUILD_ROOT |
79 | 79 | %{_mandir}/*/man1/* |
80 | 80 | |
81 | 81 | %config %{_sysconfdir}/profile.d/* |
82 | | %{_datadir}/mc/cedit.menu |
| 82 | %{_sysconfdir}/mc/cedit.menu |
83 | 83 | %{_datadir}/mc/edit.indent.rc |
84 | 84 | %{_datadir}/mc/edit.spell.rc |
85 | 85 | %{_datadir}/mc/bin/* |
86 | 86 | %{_datadir}/mc/extfs/* |
87 | | %{_datadir}/mc/mc.ext |
88 | | %{_datadir}/mc/mc.lib |
89 | | %{_datadir}/mc/mc.menu* |
| 87 | %{_sysconfdir}/mc/mc.ext |
| 88 | %{_sysconfdir}/mc/mc.lib |
| 89 | %{_sysconfdirdir}/mc/mc.menu* |
90 | 90 | %{?_with_charset:%config %{_datadir}/mc/mc.charsets} |
91 | 91 | |
92 | 92 | %{_datadir}/mc/mc.hint* |
-
diff --git a/prototype.in b/prototype.in
index fd28cae..7bb6398 100644
a
|
b
|
d none $datadir/mc/syntax |
20 | 20 | d none $docdir/mc |
21 | 21 | # |
22 | 22 | !default 644 root bin |
23 | | f none $datadir/mc/cedit.menu |
| 23 | f none $sysconfdir/mc/cedit.menu |
24 | 24 | f none $datadir/mc/edit.indent.rc |
25 | 25 | f none $datadir/mc/edit.spell.rc |
26 | | f none $datadir/mc/mc.ext |
| 26 | f none $sysconfdir/mc/mc.ext |
27 | 27 | f none $datadir/mc/mc.hint |
28 | 28 | f none $datadir/mc/mc.hint.cs |
29 | 29 | f none $datadir/mc/mc.hint.es |
… |
… |
f none $datadir/mc/mc.hlp.hu |
40 | 40 | f none $datadir/mc/mc.hlp.it |
41 | 41 | f none $datadir/mc/mc.hlp.pl |
42 | 42 | f none $datadir/mc/mc.hlp.ru |
43 | | f none $datadir/mc/mc.lib |
44 | | f none $datadir/mc/mc.menu |
| 43 | f none $sysconfdir/mc/mc.lib |
| 44 | f none $sysconfdir/mc/mc.menu |
45 | 45 | # |
46 | 46 | !search $datadir/mc/bin |
47 | 47 | # |
… |
… |
f none $datadir/mc/extfs/deb |
60 | 60 | f none $datadir/mc/extfs/deba |
61 | 61 | f none $datadir/mc/extfs/debd |
62 | 62 | f none $datadir/mc/extfs/dpkg |
63 | | f none $datadir/mc/extfs/extfs.ini |
| 63 | f none $sysconfdir/mc/extfs.ini |
64 | 64 | f none $datadir/mc/extfs/hp48 |
65 | 65 | f none $datadir/mc/extfs/lslR |
66 | 66 | f none $datadir/mc/extfs/mailfs |
… |
… |
f none $datadir/mc/extfs/patchfs |
68 | 68 | f none $datadir/mc/extfs/README |
69 | 69 | f none $datadir/mc/extfs/rpm |
70 | 70 | f none $datadir/mc/extfs/rpms |
71 | | f none $datadir/mc/extfs/sfs.ini |
| 71 | f none $sysconfdir/mc/sfs.ini |
72 | 72 | f none $datadir/mc/extfs/trpm |
73 | 73 | f none $datadir/mc/extfs/uar |
74 | 74 | f none $datadir/mc/extfs/uarj |
-
diff --git a/src/Makefile.am b/src/Makefile.am
index ccf0f8b..54dcd8c 100644
a
|
b
|
|
1 | 1 | AM_CFLAGS = $(GLIB_CFLAGS) |
2 | 2 | |
3 | 3 | localedir = $(datadir)/locale |
4 | | pkglibexecdir = $(libexecdir)/@PACKAGE@ |
| 4 | pkglibexecdir = $(libexecdir)/@PACKAGE@ |
| 5 | pkgsysconfdir = $(sysconfdir)/@PACKAGE@ |
5 | 6 | |
6 | 7 | bin_PROGRAMS = mc mcmfmt |
7 | 8 | |
8 | 9 | if CONS_SAVER |
9 | 10 | pkglibexec_PROGRAMS = cons.saver |
10 | | AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" \ |
| 11 | AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" -DMC_CONFIGDIR=\""$(pkgsysconfdir)"\" \ |
11 | 12 | -DSAVERDIR=\""$(pkglibexecdir)"\" |
12 | 13 | else |
13 | | AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" |
| 14 | AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" -DMC_CONFIGDIR=\""$(pkgsysconfdir)"\" |
14 | 15 | endif |
15 | 16 | |
16 | 17 | noinst_PROGRAMS = man2hlp |
-
diff --git a/src/boxes.c b/src/boxes.c
index 0fd2a0b..b10e1c9 100644
a
|
b
|
|
38 | 38 | #include "dialog.h" /* The nice dialog manager */ |
39 | 39 | #include "widget.h" /* The widgets for the nice dialog manager */ |
40 | 40 | #include "wtools.h" |
41 | | #include "setup.h" /* For profile_name */ |
42 | 41 | #include "profile.h" /* Load/save user formats */ |
43 | 42 | #include "key.h" /* XCTRL and ALT macros */ |
44 | 43 | #include "command.h" /* For cmdline */ |
… |
… |
|
49 | 48 | #include "tree.h" |
50 | 49 | #include "layout.h" /* for get_nth_panel_name proto */ |
51 | 50 | #include "background.h" /* task_list */ |
| 51 | #include "mc_conf.h" /* MC global configuration */ |
52 | 52 | |
53 | 53 | #ifdef HAVE_CHARSET |
54 | 54 | #include "charsets.h" |
… |
… |
display_box (WPanel *panel, char **userp, char **minip, int *use_msformat, int n |
232 | 232 | for (i = 0; i < LIST_TYPES; i++) |
233 | 233 | panel->user_status_format[i] = g_strdup (DEFAULT_USER_FORMAT); |
234 | 234 | section = g_strconcat ("Temporal:", p, (char *) NULL); |
235 | | if (!profile_has_section (section, profile_name)) { |
| 235 | if (!profile_has_section (section, mc_current_mc_ini)) { |
236 | 236 | g_free (section); |
237 | 237 | section = g_strdup (p); |
238 | 238 | } |
-
diff --git a/src/charsets.c b/src/charsets.c
index 5666c23..1ff2eaf 100644
a
|
b
|
load_codepages_list (void) |
44 | 44 | FILE *f; |
45 | 45 | char *fname; |
46 | 46 | char buf[256]; |
47 | | extern char *mc_home; |
48 | 47 | extern int display_codepage; |
49 | 48 | char *default_codepage = NULL; |
50 | 49 | |
51 | | fname = concat_dir_and_file (mc_home, CHARSETS_INDEX); |
| 50 | fname = _strcatdup(mc_global_datadir, PATH_SEP_STR CHARSETS_INDEX); |
52 | 51 | if (!(f = fopen (fname, "r"))) { |
53 | 52 | fprintf (stderr, _("Warning: file %s not found\n"), fname); |
54 | 53 | g_free (fname); |
-
diff --git a/src/cmd.c b/src/cmd.c
index 01d110f..3ff7bbe 100644
a
|
b
|
|
53 | 53 | #include "main.h" /* change_panel() */ |
54 | 54 | #include "panel.h" /* current_panel */ |
55 | 55 | #include "help.h" /* interactive_display() */ |
56 | | #include "user.h" /* MC_GLOBAL_MENU */ |
| 56 | #include "user.h" /* user_menu_cmd() */ |
| 57 | #include "profile.h" /* sync_profile() */ |
57 | 58 | #include "command.h" /* cmdline */ |
58 | 59 | #include "layout.h" /* get_current_type() */ |
59 | 60 | #include "ext.h" /* regex_command() */ |
60 | 61 | #include "boxes.h" /* cd_dialog() */ |
61 | 62 | #include "setup.h" /* save_setup() */ |
62 | | #include "profile.h" /* PROFILE_NAME */ |
63 | 63 | #include "execute.h" /* toggle_panels() */ |
| 64 | #include "mc_conf.h" /* MC global configuration */ |
64 | 65 | |
65 | 66 | #ifndef MAP_FILE |
66 | 67 | # define MAP_FILE 0 |
… |
… |
check_for_default(char *default_file, char *file) |
553 | 554 | |
554 | 555 | void ext_cmd (void) |
555 | 556 | { |
556 | | char *buffer; |
557 | | char *extdir; |
558 | | int dir; |
| 557 | int dir = 0; |
559 | 558 | |
560 | | dir = 0; |
561 | | if (geteuid () == 0){ |
| 559 | /* when root, ask whether to add global or users extfile */ |
| 560 | if (geteuid () == 0) |
562 | 561 | dir = query_dialog (_("Extension file edit"), |
563 | 562 | _(" Which extension file you want to edit? "), 0, 2, |
564 | 563 | _("&User"), _("&System Wide")); |
| 564 | |
| 565 | switch(dir) |
| 566 | { |
| 567 | case 0: |
| 568 | check_for_default (mc_global_mc_ext, mc_user_mc_ext); |
| 569 | do_edit (mc_user_mc_ext); |
| 570 | break; |
| 571 | case 1: |
| 572 | do_edit (mc_global_mc_ext); |
565 | 573 | } |
566 | | extdir = concat_dir_and_file (mc_home, MC_LIB_EXT); |
567 | 574 | |
568 | | if (dir == 0){ |
569 | | buffer = concat_dir_and_file (home_dir, MC_USER_EXT); |
570 | | check_for_default (extdir, buffer); |
571 | | do_edit (buffer); |
572 | | g_free (buffer); |
573 | | } else if (dir == 1) |
574 | | do_edit (extdir); |
| 575 | flush_extension_file (); |
| 576 | } |
| 577 | |
| 578 | static inline void menu_edit_cmd_fn(const char* fn, int chm) |
| 579 | { |
575 | 580 | |
576 | | g_free (extdir); |
577 | | flush_extension_file (); |
578 | 581 | } |
579 | 582 | |
580 | 583 | /* where = 0 - do edit file menu for mc */ |
… |
… |
void ext_cmd (void) |
582 | 585 | static void |
583 | 586 | menu_edit_cmd (int where) |
584 | 587 | { |
585 | | char *buffer; |
586 | | char *menufile; |
587 | | int dir = 0; |
588 | | |
589 | | dir = query_dialog ( |
| 588 | int dir = query_dialog ( |
590 | 589 | _(" Menu edit "), |
591 | 590 | _(" Which menu file do you want to edit? "), |
592 | 591 | 0, geteuid() ? 2 : 3, |
593 | 592 | _("&Local"), _("&User"), _("&System Wide") |
594 | 593 | ); |
595 | 594 | |
596 | | menufile = concat_dir_and_file (mc_home, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU); |
| 595 | char* globalmenu = (where ? mc_global_cedit_menu : mc_global_mc_menu); |
| 596 | char* thismenu = NULL; |
597 | 597 | |
598 | 598 | switch (dir) { |
599 | 599 | case 0: |
600 | | buffer = g_strdup (where ? CEDIT_LOCAL_MENU : MC_LOCAL_MENU); |
601 | | check_for_default (menufile, buffer); |
| 600 | thismenu = (where ? CEDIT_LOCAL_MENU : MC_LOCAL_MENU); |
| 601 | check_for_default (globalmenu, thismenu); |
602 | 602 | break; |
603 | 603 | |
604 | 604 | case 1: |
605 | | buffer = concat_dir_and_file (home_dir, where ? CEDIT_HOME_MENU : MC_HOME_MENU); |
606 | | check_for_default (menufile, buffer); |
| 605 | thismenu = (where ? mc_user_cedit_menu : mc_user_mc_menu); |
| 606 | check_for_default (globalmenu, thismenu); |
607 | 607 | break; |
608 | | |
| 608 | |
609 | 609 | case 2: |
610 | | buffer = concat_dir_and_file (mc_home, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU); |
| 610 | thismenu = globalmenu; |
611 | 611 | break; |
612 | 612 | |
613 | 613 | default: |
614 | | g_free (menufile); |
615 | 614 | return; |
616 | 615 | } |
617 | | do_edit (buffer); |
618 | | if (dir == 0) |
619 | | chmod(buffer, 0600); |
620 | | g_free (buffer); |
621 | | g_free (menufile); |
| 616 | do_edit (thismenu); |
| 617 | if (dir == 0) |
| 618 | chmod(thismenu, 0600); |
622 | 619 | } |
623 | 620 | |
624 | 621 | void quick_chdir_cmd (void) |
… |
… |
edit_user_menu_cmd (void) |
656 | 653 | void |
657 | 654 | edit_syntax_cmd (void) |
658 | 655 | { |
659 | | char *buffer; |
660 | | char *extdir; |
661 | 656 | int dir = 0; |
662 | 657 | |
663 | | if (geteuid () == 0) { |
| 658 | if (geteuid () == 0) |
664 | 659 | dir = |
665 | 660 | query_dialog (_("Syntax file edit"), |
666 | 661 | _(" Which syntax file you want to edit? "), 0, 2, |
667 | 662 | _("&User"), _("&System Wide")); |
668 | | } |
669 | | extdir = concat_dir_and_file (mc_home, "syntax" PATH_SEP_STR "Syntax"); |
670 | 663 | |
671 | | if (dir == 0) { |
672 | | buffer = concat_dir_and_file (home_dir, SYNTAX_FILE); |
673 | | check_for_default (extdir, buffer); |
674 | | do_edit (buffer); |
675 | | g_free (buffer); |
676 | | } else if (dir == 1) |
677 | | do_edit (extdir); |
678 | | |
679 | | g_free (extdir); |
| 664 | switch (dir) |
| 665 | { |
| 666 | case 0: |
| 667 | check_for_default (mc_global_syntaxfile, mc_user_syntaxfile); |
| 668 | do_edit (mc_user_syntaxfile); |
| 669 | break; |
| 670 | case 1: |
| 671 | do_edit (mc_global_syntaxfile); |
| 672 | break; |
| 673 | } |
680 | 674 | } |
681 | 675 | #endif |
682 | 676 | |
… |
… |
get_random_hint (int force) |
1060 | 1054 | return g_strdup (""); |
1061 | 1055 | last_sec = tv.tv_sec; |
1062 | 1056 | |
1063 | | data = load_mc_home_file (MC_HINT, NULL); |
| 1057 | data = load_i18n_data_file (MC_HINT, NULL); |
1064 | 1058 | if (!data) |
1065 | 1059 | return 0; |
1066 | 1060 | |
… |
… |
dirsizes_cmd (void) |
1223 | 1217 | void |
1224 | 1218 | save_setup_cmd (void) |
1225 | 1219 | { |
1226 | | char *str; |
1227 | | |
1228 | 1220 | save_setup (); |
1229 | 1221 | sync_profiles (); |
1230 | | |
1231 | | message (0, _(" Setup "), _(" Setup saved to ~/%s"), PROFILE_NAME); |
| 1222 | message (0, _(" Setup "), _(" Setup saved to ~/%s"), mc_user_mc_ini); |
1232 | 1223 | } |
1233 | 1224 | |
1234 | 1225 | static void |
-
diff --git a/src/ext.c b/src/ext.c
index 8e64d2c..6234925 100644
a
|
b
|
|
36 | 36 | #include "ext.h" |
37 | 37 | #include "view.h" |
38 | 38 | #include "execute.h" |
39 | | |
| 39 | #include "mc_conf.h" |
40 | 40 | #include "cons.saver.h" |
41 | 41 | #include "layout.h" |
42 | 42 | |
… |
… |
regex_command (const char *filename, const char *action, int *move_dir) |
436 | 436 | } |
437 | 437 | |
438 | 438 | if (data == NULL) { |
439 | | char *extension_file; |
440 | | int mc_user_ext = 1; |
441 | | int home_error = 0; |
442 | | |
443 | | extension_file = concat_dir_and_file (home_dir, MC_USER_EXT); |
444 | | if (!exist_file (extension_file)) { |
445 | | g_free (extension_file); |
446 | | check_stock_mc_ext: |
447 | | extension_file = concat_dir_and_file (mc_home, MC_LIB_EXT); |
448 | | mc_user_ext = 0; |
449 | | } |
450 | | data = load_file (extension_file); |
451 | | g_free (extension_file); |
| 439 | data = load_file (mc_current_mc_ext); |
452 | 440 | if (data == NULL) |
453 | 441 | return 0; |
454 | 442 | |
… |
… |
regex_command (const char *filename, const char *action, int *move_dir) |
457 | 445 | && !strstr (data, "type/")) { |
458 | 446 | g_free (data); |
459 | 447 | data = NULL; |
460 | | if (mc_user_ext) { |
461 | | home_error = 1; |
462 | | goto check_stock_mc_ext; |
463 | | } else { |
464 | 448 | char *title = |
465 | | g_strdup_printf (_(" %s%s file error"), |
466 | | mc_home, MC_LIB_EXT); |
467 | | message (1, title, _("The format of the %smc.ext " |
| 449 | g_strdup_printf (_(" %s file error"), |
| 450 | mc_global_mc_ext); |
| 451 | message (1, title, _("The format of the %s " |
468 | 452 | "file has changed with version 3.0. It seems that " |
469 | 453 | "the installation failed. Please fetch a fresh " |
470 | 454 | "copy from the Midnight Commander package."), |
471 | | mc_home); |
| 455 | mc_global_mc_ext); |
472 | 456 | g_free (title); |
473 | 457 | return 0; |
474 | 458 | } |
475 | | } |
476 | | } |
477 | | if (home_error) { |
478 | | char *title = |
479 | | g_strdup_printf (_(" ~/%s file error "), MC_USER_EXT); |
480 | | message (1, title, _("The format of the ~/%s file has " |
481 | | "changed with version 3.0. You may either want to copy " |
482 | | "it from %smc.ext or use that file as an example of how " |
483 | | "to write it."), MC_USER_EXT, mc_home); |
484 | | g_free (title); |
485 | 459 | } |
486 | 460 | } |
487 | 461 | mc_stat (filename, &mystat); |
-
diff --git a/src/ext.h b/src/ext.h
index c5d07f8..143b4ab 100644
a
|
b
|
int regex_command (const char *filename, const char *action, int *move_dir); |
8 | 8 | */ |
9 | 9 | void flush_extension_file (void); |
10 | 10 | |
11 | | #define MC_USER_EXT ".mc/bindings" |
12 | | #define MC_LIB_EXT "mc.ext" |
13 | | |
14 | 11 | #endif |
-
diff --git a/src/help.c b/src/help.c
index 3261cbb..2dc5a0f 100644
a
|
b
|
interactive_display (const char *filename, const char *node) |
766 | 766 | if (filename) |
767 | 767 | data = load_file (filename); |
768 | 768 | else |
769 | | data = load_mc_home_file ("mc.hlp", &hlpfile); |
| 769 | data = load_i18n_data_file ("mc.hlp", &hlpfile); |
770 | 770 | |
771 | 771 | if (data == NULL) { |
772 | 772 | message (1, MSG_ERROR, _(" Cannot open file %s \n %s "), filename ? filename : hlpfile, |
-
diff --git a/src/hotlist.c b/src/hotlist.c
index a1183cb..7a0d07e 100644
a
|
b
|
|
42 | 42 | #include "color.h" /* dialog_colors */ |
43 | 43 | #include "dialog.h" |
44 | 44 | #include "widget.h" |
45 | | #include "setup.h" /* For profile_bname */ |
| 45 | #include "mc_conf.h" /* MC global configuration */ |
46 | 46 | #include "profile.h" /* Load/save directories hotlist */ |
47 | 47 | #include "wtools.h" /* QuickDialog */ |
48 | 48 | #include "panel.h" /* current_panel */ |
… |
… |
init_hotlist (int list_type) |
615 | 615 | |
616 | 616 | hotlist_state.expanded = |
617 | 617 | GetPrivateProfileInt ("HotlistConfig", "expanded_view_of_groups", |
618 | | 0, profile_name); |
| 618 | 0, mc_current_mc_ini); |
619 | 619 | |
620 | 620 | if (list_type == LIST_VFSLIST) { |
621 | 621 | title = _("Active VFS directories"); |
… |
… |
load_group (struct hotlist *grp) |
1174 | 1174 | |
1175 | 1175 | group_section = find_group_section (grp); |
1176 | 1176 | |
1177 | | profile_keys = profile_init_iterator (group_section, profile_name); |
| 1177 | profile_keys = profile_init_iterator (group_section, mc_current_mc_ini); |
1178 | 1178 | |
1179 | 1179 | current_group = grp; |
1180 | 1180 | |
… |
… |
load_group (struct hotlist *grp) |
1184 | 1184 | } |
1185 | 1185 | g_free (group_section); |
1186 | 1186 | |
1187 | | profile_keys = profile_init_iterator (grp->directory, profile_name); |
| 1187 | profile_keys = profile_init_iterator (grp->directory, mc_current_mc_ini); |
1188 | 1188 | |
1189 | 1189 | while (profile_keys){ |
1190 | 1190 | profile_keys = profile_iterator_next (profile_keys, &key, &value); |
… |
… |
static char *tkn_buf; |
1209 | 1209 | static int tkn_buf_length; |
1210 | 1210 | static int tkn_length; |
1211 | 1211 | |
1212 | | static char *hotlist_file_name; |
1213 | 1212 | static FILE *hotlist_file; |
1214 | 1213 | static time_t hotlist_file_mtime; |
1215 | 1214 | |
… |
… |
clean_up_hotlist_groups (const char *section) |
1415 | 1414 | char *key, *value; |
1416 | 1415 | |
1417 | 1416 | grp_section = g_strconcat (section, ".Group", (char *) NULL); |
1418 | | if (profile_has_section (section, profile_name)) |
1419 | | profile_clean_section (section, profile_name); |
1420 | | if (profile_has_section (grp_section, profile_name)) { |
1421 | | profile_keys = profile_init_iterator (grp_section, profile_name); |
| 1417 | if (profile_has_section (section, mc_current_mc_ini)) |
| 1418 | profile_clean_section (section, mc_current_mc_ini); |
| 1419 | if (profile_has_section (grp_section, mc_current_mc_ini)) { |
| 1420 | profile_keys = profile_init_iterator (grp_section, mc_current_mc_ini); |
1422 | 1421 | |
1423 | 1422 | while (profile_keys) { |
1424 | 1423 | profile_keys = profile_iterator_next (profile_keys, &key, &value); |
1425 | 1424 | clean_up_hotlist_groups (key); |
1426 | 1425 | } |
1427 | | profile_clean_section (grp_section, profile_name); |
| 1426 | profile_clean_section (grp_section, mc_current_mc_ini); |
1428 | 1427 | } |
1429 | 1428 | g_free (grp_section); |
1430 | 1429 | } |
… |
… |
load_hotlist (void) |
1438 | 1437 | struct stat stat_buf; |
1439 | 1438 | |
1440 | 1439 | if (hotlist_state.loaded) { |
1441 | | stat (hotlist_file_name, &stat_buf); |
| 1440 | stat (mc_user_hotlist, &stat_buf); |
1442 | 1441 | if (hotlist_file_mtime < stat_buf.st_mtime) |
1443 | 1442 | done_hotlist (); |
1444 | 1443 | else |
1445 | 1444 | return; |
1446 | 1445 | } |
1447 | 1446 | |
1448 | | if (!hotlist_file_name) |
1449 | | hotlist_file_name = concat_dir_and_file (home_dir, HOTLIST_FILENAME); |
1450 | | |
1451 | 1447 | hotlist = new_hotlist (); |
1452 | 1448 | hotlist->type = HL_TYPE_GROUP; |
1453 | 1449 | hotlist->label = g_strdup (_(" Top level group ")); |
… |
… |
load_hotlist (void) |
1457 | 1453 | */ |
1458 | 1454 | hotlist->directory = g_strdup ("Hotlist"); |
1459 | 1455 | |
1460 | | if ((hotlist_file = fopen (hotlist_file_name, "r")) == 0) { |
| 1456 | if ((hotlist_file = fopen (mc_user_hotlist, "r")) == 0) { |
1461 | 1457 | int result; |
1462 | 1458 | |
1463 | 1459 | load_group (hotlist); |
… |
… |
load_hotlist (void) |
1472 | 1468 | remove_old_list = 1; |
1473 | 1469 | } else { |
1474 | 1470 | message (D_ERROR, _(" Hotlist Load "), |
1475 | | _("MC was unable to write ~/%s file, your old hotlist entries were not deleted"), |
1476 | | HOTLIST_FILENAME); |
| 1471 | _("MC was unable to write %s file, your old hotlist entries were not deleted"), |
| 1472 | mc_user_hotlist); |
1477 | 1473 | } |
1478 | 1474 | } else { |
1479 | 1475 | hot_load_file (hotlist); |
… |
… |
load_hotlist (void) |
1486 | 1482 | sync_profiles (); |
1487 | 1483 | } |
1488 | 1484 | |
1489 | | stat (hotlist_file_name, &stat_buf); |
| 1485 | stat (mc_user_hotlist, &stat_buf); |
1490 | 1486 | hotlist_file_mtime = stat_buf.st_mtime; |
1491 | 1487 | current_group = hotlist; |
1492 | 1488 | } |
… |
… |
save_group (struct hotlist *grp) |
1499 | 1495 | |
1500 | 1496 | group_section = find_group_section (grp); |
1501 | 1497 | |
1502 | | profile_clean_section (group_section, profile_name); |
| 1498 | profile_clean_section (group_section, mc_current_mc_ini); |
1503 | 1499 | for (;current && current->type == HL_TYPE_GROUP; current = current->next){ |
1504 | 1500 | WritePrivateProfileString (group_section, |
1505 | 1501 | current->directory, |
1506 | 1502 | current->label, |
1507 | | profile_name); |
| 1503 | mc_current_mc_ini); |
1508 | 1504 | } |
1509 | 1505 | g_free (group_section); |
1510 | 1506 | |
… |
… |
save_group (struct hotlist *grp) |
1512 | 1508 | current && current->type == HL_TYPE_GROUP; |
1513 | 1509 | current = current->next) |
1514 | 1510 | save_group (current); |
1515 | | |
1516 | | profile_clean_section (grp->directory, profile_name); |
| 1511 | |
| 1512 | profile_clean_section (grp->directory, mc_current_mc_ini); |
1517 | 1513 | for (;current; current = current->next){ |
1518 | 1514 | WritePrivateProfileString (grp->directory, |
1519 | 1515 | current->directory, |
1520 | 1516 | current->label, |
1521 | | profile_name); |
| 1517 | mc_current_mc_ini); |
1522 | 1518 | } |
1523 | 1519 | } |
1524 | 1520 | |
… |
… |
int save_hotlist (void) |
1584 | 1580 | int saved = 0; |
1585 | 1581 | struct stat stat_buf; |
1586 | 1582 | |
1587 | | if (!hotlist_state.readonly && hotlist_state.modified && hotlist_file_name) { |
1588 | | char *fbak = g_strconcat (hotlist_file_name, ".bak", (char *) NULL); |
| 1583 | if (!hotlist_state.readonly && hotlist_state.modified && mc_user_hotlist) { |
| 1584 | char *fbak = g_strconcat (mc_user_hotlist, ".bak", (char *) NULL); |
1589 | 1585 | |
1590 | | rename (hotlist_file_name, fbak); |
1591 | | if ((hotlist_file = fopen (hotlist_file_name, "w")) != 0) { |
| 1586 | rename (mc_user_hotlist, fbak); |
| 1587 | if ((hotlist_file = fopen (mc_user_hotlist, "w")) != 0) { |
1592 | 1588 | if (stat (fbak, &stat_buf) == 0) |
1593 | | chmod (hotlist_file_name, stat_buf.st_mode); |
| 1589 | chmod (mc_user_hotlist, stat_buf.st_mode); |
1594 | 1590 | else |
1595 | | chmod (hotlist_file_name, S_IRUSR | S_IWUSR); |
| 1591 | chmod (mc_user_hotlist, S_IRUSR | S_IWUSR); |
1596 | 1592 | hot_save_group (hotlist); |
1597 | 1593 | fclose (hotlist_file); |
1598 | | stat (hotlist_file_name, &stat_buf); |
| 1594 | stat (mc_user_hotlist, &stat_buf); |
1599 | 1595 | hotlist_file_mtime = stat_buf.st_mtime; |
1600 | 1596 | saved = 1; |
1601 | 1597 | hotlist_state.modified = 0; |
1602 | 1598 | } else |
1603 | | rename (fbak, hotlist_file_name); |
| 1599 | rename (fbak, mc_user_hotlist); |
1604 | 1600 | g_free (fbak); |
1605 | 1601 | } |
1606 | 1602 | |
… |
… |
void done_hotlist (void) |
1623 | 1619 | |
1624 | 1620 | hotlist_state.loaded = 0; |
1625 | 1621 | |
1626 | | g_free (hotlist_file_name); |
1627 | | hotlist_file_name = 0; |
1628 | 1622 | l_hotlist = 0; |
1629 | 1623 | current_group = 0; |
1630 | 1624 | if (tkn_buf){ |
-
diff --git a/src/learn.c b/src/learn.c
index dff560c..167caa9 100644
a
|
b
|
|
42 | 42 | #include "main.h" |
43 | 43 | #include "learn.h" |
44 | 44 | #include "wtools.h" |
| 45 | #include "mc_conf.h" /* MC global configuration */ |
45 | 46 | |
46 | 47 | #define UX 4 |
47 | 48 | #define UY 3 |
… |
… |
learn_save (void) |
314 | 315 | if (learnkeys [i].sequence != NULL) { |
315 | 316 | profile_changed = 1; |
316 | 317 | WritePrivateProfileString (section, key_name_conv_tab [i].name, |
317 | | learnkeys [i].sequence, profile_name); |
| 318 | learnkeys [i].sequence, mc_current_mc_ini); |
318 | 319 | } |
319 | 320 | } |
320 | 321 | |
-
diff --git a/src/logging.c b/src/logging.c
index bfd48e0..f1f364c 100644
a
|
b
|
|
29 | 29 | #include "global.h" |
30 | 30 | #include "logging.h" |
31 | 31 | #include "setup.h" |
| 32 | #include "mc_conf.h" /* MC global configuration */ |
32 | 33 | |
33 | 34 | /*** file scope functions **********************************************/ |
34 | 35 | |
… |
… |
is_logging_enabled(void) |
37 | 38 | { |
38 | 39 | static gboolean logging_initialized = FALSE; |
39 | 40 | static gboolean logging_enabled = FALSE; |
40 | | char *mc_ini; |
41 | 41 | |
42 | 42 | if (!logging_initialized) { |
43 | | mc_ini = g_strdup_printf("%s/%s", home_dir, PROFILE_NAME); |
44 | 43 | logging_enabled = |
45 | | get_int(mc_ini, "development.enable_logging", FALSE); |
46 | | g_free(mc_ini); |
| 44 | get_int(mc_user_mc_ini, "development.enable_logging", FALSE); |
47 | 45 | logging_initialized = TRUE; |
48 | 46 | } |
49 | 47 | return logging_enabled; |
-
diff --git a/src/main.c b/src/main.c
index 949dcf9..2c78646 100644
a
|
b
|
int midnight_shutdown = 0; |
276 | 276 | /* The user's shell */ |
277 | 277 | const char *shell = NULL; |
278 | 278 | |
279 | | /* mc_home: The home of MC */ |
280 | | char *mc_home = NULL; |
| 279 | /* global config directory (can be set via $MC_CONFIGDIR, defaults to $sysconfdir/mc) */ |
| 280 | char *mc_global_confdir = NULL; |
| 281 | |
| 282 | /* global config filenames - generated in OS_Setup() */ |
| 283 | char *mc_global_mc_ini = NULL; |
| 284 | char *mc_global_mc_ext = NULL; |
| 285 | char *mc_global_mc_menu = NULL; |
| 286 | char *mc_global_mc_lib = NULL; |
| 287 | char *mc_global_cedit_menu = NULL; |
| 288 | char *mc_global_datadir = NULL; |
| 289 | char *mc_global_syntaxdir = NULL; |
| 290 | char *mc_global_syntaxfile = NULL; |
| 291 | char *mc_user_confdir = NULL; |
| 292 | char *mc_user_mc_ini = NULL; |
| 293 | char *mc_user_hotlist = NULL; |
| 294 | char *mc_user_mc_ext = NULL; |
| 295 | char *mc_user_mc_menu = NULL; |
| 296 | char *mc_user_cedit_menu = NULL; |
| 297 | char *mc_user_syntaxfile = NULL; |
| 298 | char *mc_current_mc_ini = NULL; |
| 299 | char *mc_current_mc_ext = NULL; |
281 | 300 | |
282 | 301 | char cmd_buf[512]; |
283 | 302 | |
… |
… |
static void |
1443 | 1462 | done_mc_profile (void) |
1444 | 1463 | { |
1445 | 1464 | if (!auto_save_setup) |
1446 | | profile_forget_profile (profile_name); |
| 1465 | profile_forget_profile (mc_current_mc_ini); |
1447 | 1466 | sync_profiles (); |
1448 | 1467 | done_setup (); |
1449 | 1468 | free_profiles (); |
… |
… |
do_nc (void) |
1761 | 1780 | static void |
1762 | 1781 | OS_Setup (void) |
1763 | 1782 | { |
1764 | | const char *mc_libdir; |
1765 | 1783 | shell = getenv ("SHELL"); |
1766 | 1784 | if (!shell || !*shell) { |
1767 | 1785 | struct passwd *pwd; |
… |
… |
OS_Setup (void) |
1774 | 1792 | |
1775 | 1793 | /* This is the directory, where MC was installed, on Unix this is DATADIR */ |
1776 | 1794 | /* and can be overriden by the MC_DATADIR environment variable */ |
1777 | | if ((mc_libdir = getenv ("MC_DATADIR")) != NULL) { |
1778 | | mc_home = g_strdup (mc_libdir); |
1779 | | } else { |
1780 | | mc_home = g_strdup (DATADIR); |
1781 | | } |
| 1795 | if (!(mc_global_datadir = getenv("MC_DATADIR"))) |
| 1796 | mc_global_datadir = DATADIR; |
| 1797 | |
| 1798 | /* User's home directory: used for subshell, profile location, etc */ |
| 1799 | if (!(home_dir = getenv ("HOME"))) |
| 1800 | home_dir = mc_global_datadir; |
| 1801 | |
| 1802 | /* This is mc's global configuration directory, normally ${sysconfdir}/mc */ |
| 1803 | /* Can be overridden via MC_CONFIGDIR environment variable */ |
| 1804 | if (!(mc_global_confdir = getenv("MC_CONFIGDIR"))) |
| 1805 | mc_global_confdir = MC_CONFIGDIR; |
| 1806 | |
| 1807 | /* Render the global filenames */ |
| 1808 | mc_global_mc_ini = _strcatdup(mc_global_confdir, "/mc.ini"); |
| 1809 | mc_global_mc_menu = _strcatdup(mc_global_confdir, "/mc.menu"); |
| 1810 | mc_global_mc_ext = _strcatdup(mc_global_confdir, "/mc.ext"); |
| 1811 | mc_global_mc_lib = _strcatdup(mc_global_confdir, "/mc.lib"); |
| 1812 | mc_global_cedit_menu = _strcatdup(mc_global_confdir, "/cedit.menu"); |
| 1813 | mc_global_syntaxdir = _strcatdup(mc_global_datadir, "/syntax/"); // terminate with / ! |
| 1814 | mc_global_syntaxfile = _strcatdup(mc_global_syntaxdir, "Syntax"); |
| 1815 | |
| 1816 | /* Render user's config filenames */ |
| 1817 | mc_user_confdir = _strcatdup(home_dir, "/.mc"); |
| 1818 | mc_user_mc_ini = _strcatdup(mc_user_confdir, "/mc.ini"); |
| 1819 | mc_user_mc_ext = _strcatdup(mc_user_confdir, "/bindings"); |
| 1820 | mc_user_mc_menu = _strcatdup(mc_user_confdir, "/mc.menu"); |
| 1821 | mc_user_cedit_menu = _strcatdup(mc_user_confdir, "/cedit/menu"); |
| 1822 | mc_user_hotlist = _strcatdup(mc_user_confdir, "/hotlist"); |
| 1823 | mc_user_syntaxfile = _strcatdup(mc_user_confdir, "/cedit/Syntax"); |
| 1824 | |
| 1825 | /* Check which mc.ini to use currently */ |
| 1826 | if ((!exist_file(mc_user_mc_ini)) && (exist_file(mc_global_mc_ini))) |
| 1827 | mc_current_mc_ini = mc_global_mc_ini; |
| 1828 | else |
| 1829 | mc_current_mc_ini = mc_user_mc_ini; |
| 1830 | |
| 1831 | /* Check which mc.ext to use currently */ |
| 1832 | mc_current_mc_ext = (exist_file(mc_user_mc_ext) ? mc_user_mc_ext : mc_global_mc_ext); |
1782 | 1833 | } |
1783 | 1834 | |
1784 | 1835 | static void |
… |
… |
process_args (poptContext ctx, int c, const char *option_arg) |
1908 | 1959 | break; |
1909 | 1960 | |
1910 | 1961 | case 'f': |
1911 | | printf ("%s\n", mc_home); |
| 1962 | printf ("%s\n", mc_global_datadir); |
1912 | 1963 | exit (0); |
1913 | 1964 | break; |
1914 | 1965 | |
… |
… |
main (int argc, char *argv[]) |
2138 | 2189 | /* Set up temporary directory */ |
2139 | 2190 | mc_tmpdir (); |
2140 | 2191 | |
| 2192 | /* Initialize OS-speficic stuff, mainly config file locations, etc */ |
2141 | 2193 | OS_Setup (); |
2142 | 2194 | |
2143 | | /* This variable is used by the subshell */ |
2144 | | home_dir = getenv ("HOME"); |
2145 | | if (!home_dir) { |
2146 | | /* mc_home was computed by OS_Setup */ |
2147 | | home_dir = mc_home; |
2148 | | } |
2149 | | |
| 2195 | /* Bring up the VFS layer */ |
2150 | 2196 | vfs_init (); |
2151 | 2197 | |
2152 | 2198 | #ifdef HAVE_SLANG |
… |
… |
main (int argc, char *argv[]) |
2261 | 2307 | } |
2262 | 2308 | g_free (last_wd_string); |
2263 | 2309 | |
2264 | | g_free (mc_home); |
2265 | 2310 | done_key (); |
2266 | 2311 | #ifdef HAVE_CHARSET |
2267 | 2312 | free_codepages_list (); |
-
diff --git a/src/main.h b/src/main.h
index 3f3c695..da57a88 100644
a
|
b
|
void print_vfs_message(const char *msg, ...) |
110 | 110 | |
111 | 111 | extern const char *prompt; |
112 | 112 | extern const char *edit_one_file; |
113 | | extern char *mc_home; |
| 113 | |
114 | 114 | char *get_mc_lib_dir (void); |
115 | 115 | |
116 | 116 | int maybe_cd (int move_up_dir); |
-
diff --git a/src/mc_conf.h b/src/mc_conf.h
new file mode 100644
index 0000000..20ae138
-
|
+
|
|
| 1 | #ifndef MC_CONF_H |
| 2 | #define MC_CONF_H |
| 3 | |
| 4 | /* MC's global config directory - can be overridden by MC_CONFIGDIR environment variable */ |
| 5 | /* defaults to $sysconfdir/mc */ |
| 6 | extern char* mc_global_confir; |
| 7 | |
| 8 | /* MC's global config file names - generated from mc_configdir */ |
| 9 | extern char* mc_global_confdir; |
| 10 | extern char* mc_global_mc_ini; |
| 11 | extern char* mc_global_mc_menu; |
| 12 | extern char* mc_global_mc_ext; |
| 13 | extern char* mc_global_mc_lib; |
| 14 | extern char* mc_global_cedit_menu; |
| 15 | extern char* mc_global_datadir; |
| 16 | extern char* mc_global_syntaxdir; |
| 17 | extern char* mc_global_syntaxfile; |
| 18 | extern char* mc_user_confdir; |
| 19 | extern char* mc_user_mc_ini; |
| 20 | extern char* mc_user_hotlist; |
| 21 | extern char* mc_user_mc_ext; |
| 22 | extern char* mc_user_mc_menu; |
| 23 | extern char* mc_user_cedit_menu; |
| 24 | extern char* mc_user_syntaxfile; |
| 25 | extern char* mc_current_mc_ini; |
| 26 | extern char* mc_current_mc_ext; |
| 27 | |
| 28 | #define CEDIT_LOCAL_MENU ".cedit.menu" |
| 29 | #define MC_LOCAL_MENU ".mc.menu" |
| 30 | #define MC_HINT "mc.hint" |
| 31 | |
| 32 | #endif |
-
diff --git a/src/panelize.c b/src/panelize.c
index c2d2121..2071ce7 100644
a
|
b
|
|
43 | 43 | #include "panel.h" /* current_panel */ |
44 | 44 | #include "main.h" /* repaint_screen */ |
45 | 45 | #include "panelize.h" |
| 46 | #include "mc_conf.h" /* MC global configuration */ |
46 | 47 | |
47 | 48 | #define UX 5 |
48 | 49 | #define UY 2 |
… |
… |
void load_panelize (void) |
309 | 310 | void *profile_keys; |
310 | 311 | char *key, *value; |
311 | 312 | |
312 | | profile_keys = profile_init_iterator (panelize_section, profile_name); |
| 313 | profile_keys = profile_init_iterator (panelize_section, mc_current_mc_ini); |
313 | 314 | |
314 | 315 | add2panelize (g_strdup (_("Other command")), g_strdup ("")); |
315 | 316 | |
… |
… |
void save_panelize (void) |
330 | 331 | { |
331 | 332 | struct panelize *current = panelize; |
332 | 333 | |
333 | | profile_clean_section (panelize_section, profile_name); |
| 334 | profile_clean_section (panelize_section, mc_current_mc_ini); |
334 | 335 | for (;current; current = current->next){ |
335 | 336 | if (strcmp (current->label, _("Other command"))) |
336 | 337 | WritePrivateProfileString (panelize_section, |
337 | 338 | current->label, |
338 | 339 | current->command, |
339 | | profile_name); |
| 340 | mc_current_mc_ini); |
340 | 341 | } |
341 | 342 | sync_profiles (); |
342 | 343 | } |
-
diff --git a/src/profile.c b/src/profile.c
index cbd60e5..b948b3b 100644
a
|
b
|
static void free_profile (TProfile *p) |
452 | 452 | g_free (p); |
453 | 453 | } |
454 | 454 | |
455 | | void free_profile_name (const char *s) |
| 455 | void free_profile_by_name (const char *s) |
456 | 456 | { |
457 | 457 | TProfile *p; |
458 | 458 | |
-
diff --git a/src/profile.h b/src/profile.h
index 7600c20..080245b 100644
a
|
b
|
int profile_has_section (const char *section_name, const char *profile); |
42 | 42 | /* Forgets about a .ini file, to disable updating of it */ |
43 | 43 | void profile_forget_profile (const char *file); |
44 | 44 | |
45 | | /* Removes information from a profile */ |
46 | | void free_profile_name (const char *s); |
| 45 | /* Removes information coming from named profile */ |
| 46 | void free_profile_by_name (const char *s); |
47 | 47 | |
48 | 48 | #endif |
-
diff --git a/src/screen.c b/src/screen.c
index 74604f4..1064066 100644
a
|
b
|
|
50 | 50 | #define WANT_WIDGETS |
51 | 51 | #include "main.h" /* the_menubar */ |
52 | 52 | #include "unixcompat.h" |
| 53 | #include "mc_conf.h" /* MC global configuration */ |
53 | 54 | |
54 | 55 | #define ELEMENTS(arr) ( sizeof(arr) / sizeof((arr)[0]) ) |
55 | 56 | |
… |
… |
panel_new (const char *panel_name) |
1038 | 1039 | panel->search_buffer[0] = 0; |
1039 | 1040 | panel->frame_size = frame_half; |
1040 | 1041 | section = g_strconcat ("Temporal:", panel->panel_name, (char *) NULL); |
1041 | | if (!profile_has_section (section, profile_name)) { |
| 1042 | if (!profile_has_section (section, mc_current_mc_ini)) { |
1042 | 1043 | g_free (section); |
1043 | 1044 | section = g_strdup (panel->panel_name); |
1044 | 1045 | } |
-
diff --git a/src/setup.c b/src/setup.c
index 026ac02..9e04b1d 100644
a
|
b
|
|
42 | 42 | #include "win.h" /* lookup_key */ |
43 | 43 | #include "cmd.h" |
44 | 44 | #include "file.h" /* safe_delete */ |
| 45 | #include "mc_conf.h" /* MC global configuration */ |
45 | 46 | |
46 | 47 | #ifdef USE_VFS |
47 | 48 | #include "../vfs/gc.h" |
… |
… |
extern char *find_ignore_dirs; |
65 | 66 | |
66 | 67 | extern int num_history_items_recorded; |
67 | 68 | |
68 | | char *profile_name; /* .mc/ini */ |
69 | | char *global_profile_name; /* mc.lib */ |
70 | | |
71 | 69 | char setup_color_string [4096]; |
72 | 70 | char term_color_string [4096]; |
73 | 71 | char color_terminal_string [512]; |
74 | 72 | |
75 | | #define load_int(a,b,c) GetPrivateProfileInt(a,b,c,profile_name) |
76 | | #define load_string(a,b,c,d,e) GetPrivateProfileString(a,b,c,d,e,profile_name) |
| 73 | #define load_int(a,b,c) GetPrivateProfileInt(a,b,c,mc_current_mc_ini) |
| 74 | #define load_string(a,b,c,d,e) GetPrivateProfileString(a,b,c,d,e,mc_current_mc_ini) |
77 | 75 | #define save_string WritePrivateProfileString |
78 | 76 | |
79 | 77 | int startup_left_mode; |
… |
… |
panel_save_setup (struct WPanel *panel, const char *section) |
242 | 240 | int i; |
243 | 241 | |
244 | 242 | g_snprintf (buffer, sizeof (buffer), "%d", panel->reverse); |
245 | | save_string (section, "reverse", buffer, profile_name); |
| 243 | save_string (section, "reverse", buffer, mc_current_mc_ini); |
246 | 244 | g_snprintf (buffer, sizeof (buffer), "%d", panel->case_sensitive); |
247 | | save_string (section, "case_sensitive", buffer, profile_name); |
| 245 | save_string (section, "case_sensitive", buffer, mc_current_mc_ini); |
248 | 246 | for (i = 0; sort_names [i].key; i++) |
249 | 247 | if (sort_names [i].sort_type == (sortfn *) panel->sort_type){ |
250 | 248 | save_string (section, "sort_order", |
251 | | sort_names [i].key, profile_name); |
| 249 | sort_names [i].key, mc_current_mc_ini); |
252 | 250 | break; |
253 | 251 | } |
254 | 252 | |
255 | 253 | for (i = 0; list_types [i].key; i++) |
256 | 254 | if (list_types [i].list_type == panel->list_type){ |
257 | | save_string (section, "list_mode", list_types [i].key, profile_name); |
| 255 | save_string (section, "list_mode", list_types [i].key, mc_current_mc_ini); |
258 | 256 | break; |
259 | 257 | } |
260 | 258 | |
261 | 259 | save_string (section, "user_format", |
262 | | panel->user_format, profile_name); |
| 260 | panel->user_format, mc_current_mc_ini); |
263 | 261 | |
264 | 262 | for (i = 0; i < LIST_TYPES; i++){ |
265 | 263 | g_snprintf (buffer, sizeof (buffer), "user_status%d", i); |
266 | 264 | save_string (section, buffer, |
267 | | panel->user_status_format [i], profile_name); |
| 265 | panel->user_status_format [i], mc_current_mc_ini); |
268 | 266 | } |
269 | 267 | |
270 | 268 | g_snprintf (buffer, sizeof (buffer), "%d", panel->user_mini_status); |
271 | 269 | save_string (section, "user_mini_status", buffer, |
272 | | profile_name); |
| 270 | mc_current_mc_ini); |
273 | 271 | } |
274 | 272 | |
275 | 273 | void |
… |
… |
save_layout (void) |
279 | 277 | int i; |
280 | 278 | char buffer [BUF_TINY]; |
281 | 279 | |
282 | | profile = concat_dir_and_file (home_dir, PROFILE_NAME); |
283 | | |
284 | 280 | /* Save integer options */ |
285 | 281 | for (i = 0; layout [i].opt_name; i++){ |
286 | 282 | g_snprintf (buffer, sizeof (buffer), "%d", *layout [i].opt_addr); |
287 | | save_string ("Layout", layout [i].opt_name, buffer, profile); |
| 283 | save_string ("Layout", layout [i].opt_name, buffer, mc_user_mc_ini); |
288 | 284 | } |
289 | | |
290 | | g_free (profile); |
291 | 285 | } |
292 | 286 | |
293 | 287 | void |
294 | 288 | save_configure (void) |
295 | 289 | { |
296 | | char *profile; |
297 | 290 | int i; |
298 | 291 | |
299 | | profile = concat_dir_and_file (home_dir, PROFILE_NAME); |
300 | | |
301 | 292 | /* Save integer options */ |
302 | 293 | for (i = 0; int_options[i].opt_name; i++) |
303 | | set_int (profile, int_options[i].opt_name, *int_options[i].opt_addr); |
| 294 | set_int (mc_user_mc_ini, int_options[i].opt_name, *int_options[i].opt_addr); |
304 | 295 | |
305 | 296 | /* Save string options */ |
306 | 297 | for (i = 0; str_options[i].opt_name != NULL; i++) |
307 | | set_config_string (profile, str_options[i].opt_name, |
| 298 | set_config_string (mc_user_mc_ini, str_options[i].opt_name, |
308 | 299 | *str_options[i].opt_addr); |
309 | | |
310 | | g_free (profile); |
311 | 300 | } |
312 | 301 | |
313 | 302 | static void |
… |
… |
panel_save_type (const char *section, int type) |
318 | 307 | for (i = 0; panel_types [i].opt_name; i++) |
319 | 308 | if (panel_types [i].opt_type == type){ |
320 | 309 | save_string (section, "display", panel_types [i].opt_name, |
321 | | profile_name); |
| 310 | mc_current_mc_ini); |
322 | 311 | break; |
323 | 312 | } |
324 | 313 | } |
… |
… |
save_panel_types (void) |
341 | 330 | void |
342 | 331 | save_setup (void) |
343 | 332 | { |
344 | | char *profile; |
345 | | |
346 | 333 | saving_setup = 1; |
347 | | profile = concat_dir_and_file (home_dir, PROFILE_NAME); |
348 | 334 | |
349 | 335 | save_configure (); |
350 | 336 | |
351 | 337 | save_layout (); |
352 | 338 | save_string ("Dirs", "other_dir", |
353 | 339 | get_other_type () == view_listing |
354 | | ? other_panel->cwd : ".", profile); |
| 340 | ? other_panel->cwd : ".", mc_user_mc_ini); |
355 | 341 | if (current_panel != NULL) |
356 | 342 | WritePrivateProfileString ("Dirs", "current_is_left", |
357 | | get_current_index () == 0 ? "1" : "0", profile); |
| 343 | get_current_index () == 0 ? "1" : "0", mc_user_mc_ini); |
358 | 344 | save_hotlist (); |
359 | 345 | |
360 | 346 | save_panelize (); |
… |
… |
save_setup (void) |
363 | 349 | |
364 | 350 | #if defined(USE_VFS) && defined (USE_NETCODE) |
365 | 351 | WritePrivateProfileString ("Misc", "ftpfs_password", |
366 | | ftpfs_anonymous_passwd, profile); |
| 352 | ftpfs_anonymous_passwd, mc_user_mc_ini); |
367 | 353 | if (ftpfs_proxy_host) |
368 | 354 | WritePrivateProfileString ("Misc", "ftp_proxy_host", |
369 | | ftpfs_proxy_host, profile); |
| 355 | ftpfs_proxy_host, mc_user_mc_ini); |
370 | 356 | #endif /* USE_VFS && USE_NETCODE */ |
371 | 357 | |
372 | 358 | #ifdef HAVE_CHARSET |
373 | 359 | save_string( "Misc", "display_codepage", |
374 | | get_codepage_id( display_codepage ), profile_name ); |
| 360 | get_codepage_id( display_codepage ), mc_current_mc_ini ); |
375 | 361 | #endif /* HAVE_CHARSET */ |
376 | 362 | |
377 | | g_free (profile); |
378 | 363 | saving_setup = 0; |
379 | 364 | } |
380 | 365 | |
… |
… |
panel_load_setup (WPanel *panel, const char *section) |
409 | 394 | g_free (panel->user_format); |
410 | 395 | panel->user_format = g_strdup (get_profile_string (section, "user_format", |
411 | 396 | DEFAULT_USER_FORMAT, |
412 | | profile_name)); |
| 397 | mc_current_mc_ini)); |
413 | 398 | for (i = 0; i < LIST_TYPES; i++){ |
414 | 399 | g_free (panel->user_status_format [i]); |
415 | 400 | g_snprintf (buffer, sizeof (buffer), "user_status%d", i); |
416 | 401 | panel->user_status_format [i] = |
417 | 402 | g_strdup (get_profile_string (section, buffer, |
418 | | DEFAULT_USER_FORMAT, profile_name)); |
| 403 | DEFAULT_USER_FORMAT, mc_current_mc_ini)); |
419 | 404 | } |
420 | 405 | |
421 | 406 | panel->user_mini_status = |
… |
… |
panel_load_setup (WPanel *panel, const char *section) |
423 | 408 | |
424 | 409 | } |
425 | 410 | |
426 | | static void |
427 | | load_layout (char *profile_name) |
| 411 | static inline void |
| 412 | load_layout () |
428 | 413 | { |
429 | 414 | int i; |
430 | 415 | |
… |
… |
do_load_string (const char *s, const char *ss, const char *def) |
469 | 454 | } |
470 | 455 | #endif /* !USE_NETCODE */ |
471 | 456 | |
472 | | char * |
473 | | setup_init (void) |
474 | | { |
475 | | char *profile; |
476 | | char *inifile; |
477 | | |
478 | | if (profile_name) |
479 | | return profile_name; |
480 | | |
481 | | profile = concat_dir_and_file (home_dir, PROFILE_NAME); |
482 | | if (!exist_file (profile)){ |
483 | | inifile = concat_dir_and_file (mc_home, "mc.ini"); |
484 | | if (exist_file (inifile)){ |
485 | | g_free (profile); |
486 | | profile = inifile; |
487 | | } else |
488 | | g_free (inifile); |
489 | | } |
490 | | |
491 | | profile_name = profile; |
492 | | |
493 | | return profile; |
494 | | } |
495 | | |
496 | 457 | void |
497 | 458 | load_setup (void) |
498 | 459 | { |
499 | | char *profile; |
500 | 460 | int i; |
501 | 461 | |
502 | | profile = setup_init (); |
503 | | |
504 | | /* mc.lib is common for all users, but has priority lower than |
505 | | ~/.mc/ini. FIXME: it's only used for keys and treestore now */ |
506 | | global_profile_name = concat_dir_and_file (mc_home, "mc.lib"); |
507 | | |
508 | 462 | /* Load integer boolean options */ |
509 | 463 | for (i = 0; int_options[i].opt_name; i++) |
510 | 464 | *int_options[i].opt_addr = |
511 | | get_int (profile, int_options[i].opt_name, *int_options[i].opt_addr); |
| 465 | get_int (mc_current_mc_ini, int_options[i].opt_name, *int_options[i].opt_addr); |
512 | 466 | |
513 | 467 | /* Load string options */ |
514 | 468 | for (i = 0; str_options[i].opt_name != NULL; i++) |
515 | | *str_options[i].opt_addr = get_config_string (profile, |
| 469 | *str_options[i].opt_addr = get_config_string (mc_current_mc_ini, |
516 | 470 | str_options[i].opt_name, str_options[i].opt_defval); |
517 | 471 | |
518 | | load_layout (profile); |
| 472 | load_layout (); |
519 | 473 | |
520 | 474 | load_panelize (); |
521 | 475 | |
… |
… |
load_setup (void) |
539 | 493 | } |
540 | 494 | |
541 | 495 | boot_current_is_left = |
542 | | GetPrivateProfileInt ("Dirs", "current_is_left", 1, profile); |
| 496 | GetPrivateProfileInt ("Dirs", "current_is_left", 1, mc_current_mc_ini); |
543 | 497 | |
544 | 498 | #ifdef USE_NETCODE |
545 | 499 | ftpfs_proxy_host = do_load_string ("Misc", "ftp_proxy_host", "gate"); |
… |
… |
load_setup (void) |
561 | 515 | /* Load the directory history */ |
562 | 516 | /* directory_history_load (); */ |
563 | 517 | /* Remove the temporal entries */ |
564 | | profile_clean_section ("Temporal:New Left Panel", profile_name); |
565 | | profile_clean_section ("Temporal:New Right Panel", profile_name); |
| 518 | profile_clean_section ("Temporal:New Left Panel", mc_current_mc_ini); |
| 519 | profile_clean_section ("Temporal:New Right Panel", mc_current_mc_ini); |
566 | 520 | #if defined(USE_VFS) && defined (USE_NETCODE) |
567 | 521 | ftpfs_init_passwd (); |
568 | 522 | #endif /* USE_VFS && USE_NETCODE */ |
… |
… |
load_anon_passwd () |
596 | 550 | |
597 | 551 | void done_setup (void) |
598 | 552 | { |
599 | | g_free (profile_name); |
600 | | g_free (global_profile_name); |
601 | 553 | done_hotlist (); |
602 | 554 | done_panelize (); |
603 | 555 | /* directory_history_free (); */ |
… |
… |
void load_key_defs (void) |
641 | 593 | * Load keys from mc.lib before ~/.mc/ini, so that the user |
642 | 594 | * definitions override global settings. |
643 | 595 | */ |
644 | | load_keys_from_section ("general", global_profile_name); |
645 | | load_keys_from_section (getenv ("TERM"), global_profile_name); |
646 | | load_keys_from_section ("general", profile_name); |
647 | | load_keys_from_section (getenv ("TERM"), profile_name); |
| 596 | load_keys_from_section ("general", mc_global_mc_lib); |
| 597 | load_keys_from_section (getenv ("TERM"), mc_global_mc_lib); |
| 598 | load_keys_from_section ("general", mc_current_mc_ini); |
| 599 | load_keys_from_section (getenv ("TERM"), mc_current_mc_ini); |
648 | 600 | |
649 | 601 | /* We don't want a huge database loaded in core */ |
650 | | free_profile_name (global_profile_name); |
| 602 | free_profile_by_name (mc_global_mc_lib); |
651 | 603 | } |
-
diff --git a/src/setup.h b/src/setup.h
index c611e93..aa1de22 100644
a
|
b
|
|
3 | 3 | |
4 | 4 | #include "panel.h" |
5 | 5 | |
6 | | char *setup_init (void); |
7 | 6 | void save_layout (void); |
8 | 7 | void save_configure (void); |
9 | 8 | void load_setup (void); |
… |
… |
char *load_anon_passwd (void); |
15 | 14 | void panel_save_setup (struct WPanel *panel, const char *section); |
16 | 15 | void panel_load_setup (struct WPanel *panel, const char *section); |
17 | 16 | |
18 | | extern char *profile_name; |
19 | | extern char *global_profile_name; |
20 | | |
21 | 17 | extern char setup_color_string[]; |
22 | 18 | extern char term_color_string[]; |
23 | 19 | extern char color_terminal_string[]; |
… |
… |
extern int startup_left_mode; |
26 | 22 | extern int startup_right_mode; |
27 | 23 | extern int verbose; |
28 | 24 | |
29 | | #define PROFILE_NAME ".mc/ini" |
30 | | #define HOTLIST_FILENAME ".mc/hotlist" |
31 | | |
32 | 25 | #endif |
-
diff --git a/src/treestore.c b/src/treestore.c
index 426b0c2..493f34f 100644
a
|
b
|
|
46 | 46 | #include "treestore.h" |
47 | 47 | #include "profile.h" |
48 | 48 | #include "setup.h" |
| 49 | #include "mc_conf.h" /* MC global configuration */ |
49 | 50 | |
50 | 51 | #define TREE_SIGNATURE "Midnight Commander TreeStore v 2.0" |
51 | 52 | |
… |
… |
should_skip_directory(const char *dir) |
752 | 753 | |
753 | 754 | if (loaded == 0) { |
754 | 755 | loaded = 1; |
755 | | setup_init(); |
756 | | process_special_dirs(&special_dirs, profile_name); |
757 | | process_special_dirs(&special_dirs, global_profile_name); |
| 756 | process_special_dirs(&special_dirs, mc_current_mc_ini); |
| 757 | process_special_dirs(&special_dirs, mc_global_mc_lib); |
758 | 758 | } |
759 | 759 | |
760 | 760 | for (l = special_dirs; l; l = l->next) { |
-
diff --git a/src/user.c b/src/user.c
index 01022aa..8a0fb20 100644
a
|
b
|
|
33 | 33 | #include "layout.h" |
34 | 34 | #include "execute.h" |
35 | 35 | #include "setup.h" |
| 36 | #include "mc_conf.h" |
36 | 37 | |
37 | 38 | #include "../edit/edit.h" /* BLOCK_FILE */ |
38 | 39 | #include "../edit/edit-widget.h" /* WEdit */ |
… |
… |
user_menu_cmd (struct WEdit *edit_widget) |
717 | 718 | return; |
718 | 719 | } |
719 | 720 | |
720 | | menu = g_strdup (edit_widget ? CEDIT_LOCAL_MENU : MC_LOCAL_MENU); |
| 721 | menu = (edit_widget ? CEDIT_LOCAL_MENU : MC_LOCAL_MENU); |
721 | 722 | if (!exist_file (menu) || !menu_file_own (menu)){ |
722 | | g_free (menu); |
723 | | menu = concat_dir_and_file \ |
724 | | (home_dir, edit_widget ? CEDIT_HOME_MENU : MC_HOME_MENU); |
| 723 | menu = (edit_widget ? mc_user_cedit_menu : mc_user_mc_menu); |
725 | 724 | if (!exist_file (menu)){ |
726 | | g_free (menu); |
727 | | menu = concat_dir_and_file \ |
728 | | (mc_home, edit_widget ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU); |
| 725 | menu = (edit_widget ? mc_global_cedit_menu : mc_global_mc_menu); |
729 | 726 | } |
730 | 727 | } |
731 | 728 | |
732 | 729 | if ((data = load_file (menu)) == NULL){ |
733 | 730 | message (1, MSG_ERROR, _(" Cannot open file %s \n %s "), |
734 | 731 | menu, unix_error_string (errno)); |
735 | | g_free (menu); |
736 | 732 | menu = NULL; |
737 | 733 | return; |
738 | 734 | } |
739 | | |
| 735 | |
740 | 736 | max_cols = 0; |
741 | 737 | selected = 0; |
742 | 738 | menu_limit = 0; |
… |
… |
user_menu_cmd (struct WEdit *edit_widget) |
836 | 832 | do_refresh (); |
837 | 833 | } |
838 | 834 | |
839 | | easy_patterns = old_patterns; |
840 | | g_free (menu); |
841 | 835 | menu = NULL; |
| 836 | easy_patterns = old_patterns; |
842 | 837 | g_free (entries); |
843 | 838 | g_free (data); |
844 | 839 | } |
-
diff --git a/src/user.h b/src/user.h
index 72997dc..598d6b5 100644
a
|
b
|
int check_format_view (const char *); |
9 | 9 | int check_format_var (const char *, char **); |
10 | 10 | int check_format_cd (const char *); |
11 | 11 | |
12 | | #define CEDIT_GLOBAL_MENU "cedit.menu" |
13 | | #define CEDIT_LOCAL_MENU ".cedit.menu" |
14 | | #define CEDIT_HOME_MENU ".mc/cedit/menu" |
15 | | #define MC_GLOBAL_MENU "mc.menu" |
16 | | #define MC_LOCAL_MENU ".mc.menu" |
17 | | #define MC_HOME_MENU ".mc/menu" |
18 | | #define MC_HINT "mc.hint" |
19 | | |
20 | 12 | #endif |
-
diff --git a/src/util.c b/src/util.c
index da6d1b2..20a79b4 100644
a
|
b
|
|
37 | 37 | |
38 | 38 | #include "global.h" |
39 | 39 | #include "profile.h" |
40 | | #include "main.h" /* mc_home */ |
| 40 | #include "main.h" |
| 41 | #include "mc_conf.h" /* MC global configuration */ |
41 | 42 | #include "cmd.h" /* guess_message_value */ |
42 | 43 | #include "mountlist.h" |
43 | 44 | #include "win.h" /* xterm_flag */ |
… |
… |
set_config_string (const char *file, const char *key, const char *val) |
644 | 645 | (void)WritePrivateProfileString (app_text, key, val, file); |
645 | 646 | } |
646 | 647 | |
647 | | int |
648 | | exist_file (const char *name) |
649 | | { |
650 | | return access (name, R_OK) == 0; |
651 | | } |
652 | | |
653 | 648 | char * |
654 | 649 | load_file (const char *filename) |
655 | 650 | { |
… |
… |
load_file (const char *filename) |
679 | 674 | } |
680 | 675 | |
681 | 676 | char * |
682 | | load_mc_home_file (const char *filename, char **allocated_filename) |
| 677 | load_i18n_data_file (const char *filename, char **allocated_filename) |
683 | 678 | { |
684 | 679 | char *hintfile_base, *hintfile; |
685 | 680 | char *lang; |
686 | 681 | char *data; |
687 | 682 | |
688 | | hintfile_base = concat_dir_and_file (mc_home, filename); |
| 683 | hintfile_base = concat_dir_and_file (mc_global_datadir, filename); |
689 | 684 | lang = guess_message_value (); |
690 | 685 | |
691 | 686 | hintfile = g_strconcat (hintfile_base, ".", lang, (char *) NULL); |
-
diff --git a/src/util.h b/src/util.h
index 4e9a113..a26e434 100644
a
|
b
|
extern char * get_config_string (const char *, const char *, const char *); |
92 | 92 | extern void set_config_string (const char *, const char *, const char *); |
93 | 93 | |
94 | 94 | char *load_file (const char *filename); |
95 | | char *load_mc_home_file (const char *filename, char ** allocated_filename); |
| 95 | char *load_i18n_data_file (const char *filename, char ** allocated_filename); |
96 | 96 | |
97 | 97 | /* uid/gid managing */ |
98 | 98 | void init_groups (void); |
… |
… |
char *get_owner (int); |
110 | 110 | size_t i18n_checktimelength (void); |
111 | 111 | const char *file_date (time_t); |
112 | 112 | |
113 | | int exist_file (const char *name); |
| 113 | #define exist_file(fn) (( access(fn, R_OK) == 0 )) |
114 | 114 | |
115 | 115 | /* Returns a copy of *s until a \n is found and is below top */ |
116 | 116 | const char *extract_line (const char *s, const char *top); |
… |
… |
extern int ascii_alpha_to_cntrl (int ch); |
256 | 256 | #undef Q_ |
257 | 257 | const char *Q_ (const char *s); |
258 | 258 | |
| 259 | /* concat two strings into a new (malloc()'ed) buffer */ |
| 260 | static inline char* _strcatdup(const char* one, const char* two) |
| 261 | { |
| 262 | int sz = strlen(one)+strlen(two)+2; |
| 263 | char* buf = (char*)malloc(sz); |
| 264 | strcpy(buf,one); |
| 265 | strcat(buf,two); |
| 266 | return buf; |
| 267 | } |
| 268 | |
259 | 269 | #endif |
-
diff --git a/vfs/extfs.c b/vfs/extfs.c
index d634e33..6c8eede 100644
a
|
b
|
|
43 | 43 | #include "../src/execute.h" /* For shell_execute */ |
44 | 44 | #include "vfs.h" |
45 | 45 | #include "vfs-impl.h" |
46 | | #include "gc.h" /* vfs_rmstamp */ |
| 46 | #include "gc.h" /* vfs_rmstamp */ |
| 47 | #include "../src/mc_conf.h" /* MC global configuration */ |
47 | 48 | |
48 | 49 | #undef ERRNOR |
49 | 50 | #define ERRNOR(x,y) do { my_errno = x; return y; } while(0) |
… |
… |
static char *extfs_prefixes [MAXEXTFS]; |
109 | 110 | static char extfs_need_archive [MAXEXTFS]; |
110 | 111 | static int extfs_no = 0; |
111 | 112 | |
| 113 | static char *mc_extfs_ini; |
| 114 | static char *mc_extfs_scripts; |
| 115 | |
| 116 | /* initialize and return script directory name */ |
| 117 | static inline char* _getscriptdir() |
| 118 | { |
| 119 | if (mc_extfs_scripts) |
| 120 | return mc_extfs_scripts; |
| 121 | |
| 122 | mc_extfs_scripts = _strcatdup(mc_global_confdir, PATH_SEP_STR "extfs" PATH_SEP_STR); |
| 123 | return mc_extfs_scripts; |
| 124 | } |
| 125 | |
| 126 | /* initialize and return extfs.ini pathname */ |
| 127 | static inline char* _getini() |
| 128 | { |
| 129 | if (mc_extfs_ini) |
| 130 | return mc_extfs_ini; |
| 131 | |
| 132 | /* first try to open user's own extfs.ini, then fallback to global one */ |
| 133 | mc_extfs_ini = _strcatdup(mc_user_confdir, PATH_SEP_STR "extfs.ini"); |
| 134 | if (exist_file(mc_extfs_ini)) |
| 135 | return mc_extfs_ini; |
| 136 | |
| 137 | free(mc_extfs_ini); |
| 138 | mc_extfs_ini = _strcatdup(mc_global_confdir, PATH_SEP_STR "extfs.ini"); |
| 139 | |
| 140 | return mc_extfs_ini; |
| 141 | } |
| 142 | |
112 | 143 | static void |
113 | 144 | extfs_fill_names (struct vfs_class *me, fill_names_f func) |
114 | 145 | { |
… |
… |
extfs_open_archive (int fstype, const char *name, struct archive **pparc) |
228 | 259 | FILE *result; |
229 | 260 | mode_t mode; |
230 | 261 | char *cmd; |
231 | | char *mc_extfsdir; |
232 | 262 | struct stat mystat; |
233 | 263 | struct archive *current_archive; |
234 | 264 | struct entry *root_entry; |
… |
… |
extfs_open_archive (int fstype, const char *name, struct archive **pparc) |
246 | 276 | tmp = name_quote (name, 0); |
247 | 277 | } |
248 | 278 | |
249 | | mc_extfsdir = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR); |
250 | 279 | cmd = |
251 | | g_strconcat (mc_extfsdir, extfs_prefixes[fstype], " list ", |
| 280 | g_strconcat (_getscriptdir(), extfs_prefixes[fstype], " list ", |
252 | 281 | local_name ? local_name : tmp, (char *) NULL); |
253 | 282 | g_free (tmp); |
254 | | g_free (mc_extfsdir); |
255 | 283 | open_error_pipe (); |
256 | 284 | result = popen (cmd, "r"); |
257 | 285 | g_free (cmd); |
… |
… |
extfs_cmd (const char *extfs_cmd, struct archive *archive, |
611 | 639 | char *quoted_file; |
612 | 640 | char *quoted_localname; |
613 | 641 | char *archive_name; |
614 | | char *mc_extfsdir; |
615 | 642 | char *cmd; |
616 | 643 | int retval; |
617 | 644 | |
… |
… |
extfs_cmd (const char *extfs_cmd, struct archive *archive, |
621 | 648 | archive_name = name_quote (extfs_get_archive_name (archive), 0); |
622 | 649 | quoted_localname = name_quote (localname, 0); |
623 | 650 | |
624 | | mc_extfsdir = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR); |
625 | | cmd = g_strconcat (mc_extfsdir, extfs_prefixes[archive->fstype], |
| 651 | cmd = g_strconcat (_getscriptdir, extfs_prefixes[archive->fstype], |
626 | 652 | extfs_cmd, archive_name, " ", quoted_file, " ", |
627 | 653 | quoted_localname, (char *) NULL); |
628 | 654 | g_free (quoted_file); |
629 | 655 | g_free (quoted_localname); |
630 | | g_free (mc_extfsdir); |
631 | 656 | g_free (archive_name); |
632 | 657 | |
633 | 658 | open_error_pipe (); |
… |
… |
static void |
641 | 666 | extfs_run (struct vfs_class *me, const char *file) |
642 | 667 | { |
643 | 668 | struct archive *archive = NULL; |
644 | | char *p, *q, *archive_name, *mc_extfsdir; |
| 669 | char *p, *q, *archive_name; |
645 | 670 | char *cmd; |
646 | 671 | |
647 | 672 | if ((p = extfs_get_path (me, file, &archive, 0)) == NULL) |
… |
… |
extfs_run (struct vfs_class *me, const char *file) |
650 | 675 | g_free (p); |
651 | 676 | |
652 | 677 | archive_name = name_quote (extfs_get_archive_name (archive), 0); |
653 | | mc_extfsdir = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR); |
654 | | cmd = g_strconcat (mc_extfsdir, extfs_prefixes[archive->fstype], |
| 678 | cmd = g_strconcat (_getscriptdir(), extfs_prefixes[archive->fstype], |
655 | 679 | " run ", archive_name, " ", q, (char *) NULL); |
656 | | g_free (mc_extfsdir); |
657 | 680 | g_free (archive_name); |
658 | 681 | g_free (q); |
659 | 682 | shell_execute (cmd, 0); |
… |
… |
extfs_ungetlocalcopy (struct vfs_class *me, const char *path, |
1286 | 1309 | } |
1287 | 1310 | } |
1288 | 1311 | |
1289 | | |
1290 | 1312 | static int extfs_init (struct vfs_class *me) |
1291 | 1313 | { |
1292 | 1314 | FILE *cfg; |
1293 | | char *mc_extfsini; |
1294 | 1315 | char key[256]; |
1295 | 1316 | |
1296 | 1317 | (void) me; |
1297 | 1318 | |
1298 | | mc_extfsini = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR "extfs.ini"); |
1299 | | cfg = fopen (mc_extfsini, "r"); |
1300 | | |
1301 | 1319 | /* We may not use vfs_die() message or message or similar, |
1302 | 1320 | * UI is not initialized at this time and message would not |
1303 | 1321 | * appear on screen. */ |
1304 | | if (!cfg) { |
1305 | | fprintf (stderr, _("Warning: file %s not found\n"), mc_extfsini); |
1306 | | g_free (mc_extfsini); |
| 1322 | if ((cfg=fopen(_getini(), "r"))==NULL) { |
| 1323 | fprintf (stderr, _("Warning: file %s not found\n"), mc_extfs_ini); |
| 1324 | free (mc_extfs_ini); |
| 1325 | mc_extfs_ini = NULL; |
1307 | 1326 | return 0; |
1308 | 1327 | } |
1309 | 1328 | |
… |
… |
static int extfs_init (struct vfs_class *me) |
1317 | 1336 | |
1318 | 1337 | if (*key == '[') { |
1319 | 1338 | fprintf(stderr, "Warning: You need to update your %s file.\n", |
1320 | | mc_extfsini); |
| 1339 | mc_extfs_ini); |
1321 | 1340 | fclose(cfg); |
1322 | | g_free (mc_extfsini); |
| 1341 | free (mc_extfs_ini); |
| 1342 | mc_extfs_ini = NULL; |
1323 | 1343 | return 0; |
1324 | 1344 | } |
1325 | 1345 | if (*key == '#' || *key == '\n') |
… |
… |
static int extfs_init (struct vfs_class *me) |
1339 | 1359 | extfs_prefixes [extfs_no++] = g_strdup (key); |
1340 | 1360 | } |
1341 | 1361 | fclose(cfg); |
1342 | | g_free (mc_extfsini); |
| 1362 | free (mc_extfs_ini); |
| 1363 | mc_extfs_ini = NULL; |
1343 | 1364 | return 1; |
1344 | 1365 | } |
1345 | 1366 | |
-
diff --git a/vfs/extfs/Makefile.am b/vfs/extfs/Makefile.am
index e7efbe4..e4149df 100644
a
|
b
|
|
1 | 1 | extfsdir = $(pkgdatadir)/extfs |
| 2 | extfsconfdir = $(sysconfdir)/mc |
| 3 | |
| 4 | # Extfs config files |
| 5 | EXTFS_CONF = extfs.ini sfs.ini |
2 | 6 | |
3 | 7 | # Files to install and distribute other than extfs scripts |
4 | | EXTFS_MISC = README extfs.ini sfs.ini |
| 8 | EXTFS_MISC = README |
5 | 9 | |
6 | 10 | # Scripts hat don't need adaptation to the local system |
7 | 11 | EXTFS_CONST = bpp rpm trpm u7z |
… |
… |
EXTFS_OUT = \ |
57 | 61 | if USE_VFS |
58 | 62 | extfs_DATA = $(EXTFS_MISC) |
59 | 63 | extfs_SCRIPTS = $(EXTFS_CONST) $(EXTFS_OUT) |
| 64 | extfsconf_DATA = $(EXTFS_CONF) |
60 | 65 | endif |
61 | 66 | |
62 | 67 | EXTRA_DIST = $(EXTFS_MISC) $(EXTFS_CONST) |
-
diff --git a/vfs/ftpfs.c b/vfs/ftpfs.c
index 43d363c..a3a511b 100644
a
|
b
|
What to do with this? |
73 | 73 | #include "../src/tty.h" /* enable/disable interrupt key */ |
74 | 74 | #include "../src/wtools.h" /* message() */ |
75 | 75 | #include "../src/main.h" /* print_vfs_message */ |
| 76 | #include "../src/mc_conf.h" /* MC global configuration */ |
76 | 77 | #include "utilvfs.h" |
77 | 78 | #include "xdirentry.h" |
78 | 79 | #include "vfs.h" |
… |
… |
ftpfs_load_no_proxy_list (void) |
554 | 555 | if (mc_file) |
555 | 556 | return; |
556 | 557 | |
557 | | mc_file = concat_dir_and_file (mc_home, "mc.no_proxy"); |
| 558 | mc_file = _strcatdup(mc_global_confdir, "mc.no_proxy"); |
558 | 559 | if (exist_file (mc_file) && |
559 | 560 | (npf = fopen (mc_file, "r"))) { |
560 | 561 | while (fgets (s, sizeof (s), npf)) { |
-
diff --git a/vfs/sfs.c b/vfs/sfs.c
index f4989ca..cac218a 100644
a
|
b
|
|
38 | 38 | #include "../src/tty.h" /* enable/disable interrupt key */ |
39 | 39 | #include "../src/wtools.h" /* message() */ |
40 | 40 | #include "../src/main.h" /* print_vfs_message */ |
| 41 | #include "../src/mc_conf.h" /* MC global configuration */ |
41 | 42 | #include "utilvfs.h" |
42 | 43 | #include "vfs.h" |
43 | 44 | #include "vfs-impl.h" |
… |
… |
sfs_ungetlocalcopy (struct vfs_class *me, const char *path, |
330 | 331 | |
331 | 332 | static int sfs_init (struct vfs_class *me) |
332 | 333 | { |
333 | | char *mc_sfsini; |
| 334 | char *mc_sfs_ini; |
334 | 335 | FILE *cfg; |
335 | 336 | char key[256]; |
336 | 337 | |
337 | 338 | (void) me; |
338 | 339 | |
339 | | mc_sfsini = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR "sfs.ini"); |
340 | | cfg = fopen (mc_sfsini, "r"); |
| 340 | /* first try to use user's config file, then fallback to global one */ |
| 341 | mc_sfs_ini = _strcatdup(mc_user_confdir, PATH_SEP_STR "sfs.ini"); |
| 342 | if (!exist_file(mc_sfs_ini)) |
| 343 | { |
| 344 | free(mc_sfs_ini); |
| 345 | mc_sfs_ini = _strcatdup(mc_global_confdir, PATH_SEP_STR "sfs.ini"); |
| 346 | } |
341 | 347 | |
342 | | if (!cfg){ |
343 | | fprintf (stderr, _("Warning: file %s not found\n"), mc_sfsini); |
344 | | g_free (mc_sfsini); |
| 348 | if ((cfg=fopen(mc_sfs_ini, "r"))==NULL) { |
| 349 | fprintf (stderr, _("Warning: file %s not found\n"), mc_sfs_ini); |
| 350 | free (mc_sfs_ini); |
345 | 351 | return 0; |
346 | 352 | } |
347 | | g_free (mc_sfsini); |
| 353 | free (mc_sfs_ini); |
348 | 354 | |
349 | 355 | sfs_no = 0; |
350 | 356 | while (sfs_no < MAXFS && fgets (key, sizeof (key), cfg)) { |