Merge branch '2990_cleanup'
* 2990_cleanup: (32 commits) Remove LC_ALL from info_size. INFO file generate without LC_ALL e.g. in current locale. Size must be computed with same locale, otherwise INFO file will be chopped of mceditor: last_bracket: make member of WEdit. Use "'" instead of "`" for messages and comments quoting. Search callbacks should return mc_search_cbret_t not int. Fix filename for msppt in ext.d/doc.sh: use $MC_EXT_FILENAME not %f. Fix info for ogg files in sound.sh Minor otimization of syntax highlightimg engine: (compare_word_to_right): use correct upper boundary of scanned text. option_whole_chars_search: unsed variable. Remove it and related code. (edit_update_screen): fix of editor frame drawing. src/editor/editcmd.c: remove unneeded include layout.h. Fix documentation: use actual menu item names. (edit_about): update year. (vfs_get_encoding): optimization and enhancement: (button_set_text): update value of WButton::hotpos. Use tty_draw_box instead of draw_box() to draw frames. (smbfs_fake_share_stat): don't access to free'd memory. Remove vfs_path_to_str() function for avoid often memory allocations. Use G_N_ELEMENTS macro to calculate of array size. WEdit::labels is unused. Remove. ...
Этот коммит содержится в:
Коммит
6b64835a7e
@ -20,11 +20,11 @@ CONFIG_STATUS_DEPENDENCIES = $(top_srcdir)/version.h
|
||||
.PHONY: update-version
|
||||
|
||||
update-version:
|
||||
@if test -x $(top_srcdir)/maint/version.sh; then \
|
||||
$(top_srcdir)/maint/version.sh "$(top_srcdir)" 2>&1 >/dev/null; \
|
||||
@if test -x $(top_srcdir)/maint/utils/version.sh; then \
|
||||
$(top_srcdir)/maint/utils/version.sh "$(top_srcdir)" 2>&1 >/dev/null; \
|
||||
else \
|
||||
if test ! -e $(top_srcdir)/version.h; then \
|
||||
echo "File not found: $(top_srcdir)/maint/version.sh"; \
|
||||
echo "File not found: $(top_srcdir)/maint/utils/version.sh"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi
|
||||
|
@ -23,7 +23,7 @@ set -e
|
||||
|
||||
$AUTOPOINT --version >/dev/null 2>&1
|
||||
if test $? -ne 0; then
|
||||
AUTOPOINT=maint/autopoint
|
||||
AUTOPOINT=maint/utils/autopoint
|
||||
fi
|
||||
|
||||
cd "$srcdir"
|
||||
@ -84,7 +84,7 @@ test -f configure || \
|
||||
{ echo "autoconf failed to generate src/vfs/smbfs/helpers/configure" >&2; exit 1; }
|
||||
) || exit 1
|
||||
|
||||
$srcdir/maint/version.sh "$srcdir"
|
||||
$srcdir/maint/utils/version.sh "$srcdir"
|
||||
|
||||
if test -x $srcdir/configure.mc; then
|
||||
$srcdir/configure.mc "$@"
|
||||
|
17
configure.ac
17
configure.ac
@ -156,13 +156,10 @@ dnl ############################################################################
|
||||
dnl Check for header files
|
||||
dnl ############################################################################
|
||||
|
||||
AC_CHECK_HEADERS([unistd.h string.h memory.h limits.h malloc.h \
|
||||
utime.h fcntl.h sys/statfs.h sys/vfs.h sys/time.h \
|
||||
AC_CHECK_HEADERS([string.h memory.h limits.h malloc.h \
|
||||
utime.h sys/statfs.h sys/vfs.h \
|
||||
sys/select.h sys/ioctl.h stropts.h arpa/inet.h \
|
||||
sys/socket.h sys/sysmacros.h sys/types.h sys/mkdev.h])
|
||||
AC_HEADER_MAJOR
|
||||
AC_HEADER_TIME
|
||||
AC_HEADER_DIRENT
|
||||
sys/socket.h sys/sysmacros.h sys/mkdev.h])
|
||||
AC_HEADER_ASSERT
|
||||
|
||||
|
||||
@ -170,7 +167,6 @@ dnl ############################################################################
|
||||
dnl Check for types
|
||||
dnl ############################################################################
|
||||
|
||||
AC_C_CONST
|
||||
dnl Check largefile before type sizeof checks
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
@ -226,15 +222,10 @@ dnl Check for functions
|
||||
dnl ############################################################################
|
||||
|
||||
AC_CHECK_FUNCS([\
|
||||
isascii \
|
||||
statfs sysconf \
|
||||
tcgetattr tcsetattr \
|
||||
ftruncate \
|
||||
strverscmp \
|
||||
strncasecmp \
|
||||
realpath
|
||||
])
|
||||
AC_FUNC_STRCOLL
|
||||
|
||||
dnl getpt is a GNU Extension (glibc 2.1.x)
|
||||
AC_CHECK_FUNCS(posix_openpt, , [AC_CHECK_FUNCS(getpt)])
|
||||
@ -280,8 +271,6 @@ dnl ############################################################################
|
||||
dnl OS specific flags
|
||||
dnl ############################################################################
|
||||
|
||||
AC_ISC_POSIX
|
||||
|
||||
case $host_os in
|
||||
aux*)
|
||||
# A/UX
|
||||
|
@ -1,3 +1,4 @@
|
||||
.\" -*- mode: troff; coding: utf8 -*-
|
||||
.\" Traducido el 6 de septiembre de 1998 por
|
||||
.\" Francisco Gabriel Aroca Tapia <fgat1@alu.um.es>
|
||||
.\"
|
||||
@ -250,7 +251,7 @@ Una doble pulsación sobre un archivo intentará ejecutar el comando si se trata
|
||||
un programa ejecutable; y si la extensión del archivo tiene un programa
|
||||
.\"LINK2"
|
||||
asociado a esa extensión\&,
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
se ejecuta el programa especificado.
|
||||
.PP
|
||||
Además, es posible ejecutar los comandos asignados a las teclas de función
|
||||
@ -351,9 +352,9 @@ a:
|
||||
.IP
|
||||
.br
|
||||
1) Opción de ejecución en línea de órdenes
|
||||
.B \-K \<mapa\>
|
||||
.B \-K <mapa>
|
||||
o
|
||||
.B \-\-keymap=\<mapa\>
|
||||
.B \-\-keymap=<mapa>
|
||||
.br
|
||||
2) Variable de entorno
|
||||
.B MC_KEYMAP
|
||||
@ -398,7 +399,7 @@ si la extensión del archivo seleccionado coincide con una de las
|
||||
extensiones en el
|
||||
.\"LINK2"
|
||||
archivo de extensiones
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
entonces se ejecuta la aplicación correspondiente.
|
||||
.TP
|
||||
.B Ctrl\-l
|
||||
@ -1063,7 +1064,7 @@ de nuevo para obtener la lista completa de teclas válidas.
|
||||
Invoca el
|
||||
.\"LINK2"
|
||||
Menú de usuario
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
El menú de usuario otorga una manera fácil de tener usuarios con un menú
|
||||
y añadir asimismo características extra a Midnight Commander.
|
||||
.PP
|
||||
@ -1300,14 +1301,14 @@ programa al panel actual.
|
||||
.PP
|
||||
.\"LINK2"
|
||||
Editar el archivo de extensiones
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
nos permite especificar los programas a ejecutar para intentar
|
||||
ejecutar, ver, editar y realizar un montón de cosas sobre archivos
|
||||
con ciertas extensiones (terminaciones de archivo). Por ejemplo, asociar la extensión
|
||||
de los archivos de audio de SUN (.au) con el programa reproductor adecuado.
|
||||
.\"LINK2"
|
||||
Editar archivo de menú
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
se puede utilizar para editar el menú de usuario (el que aparece al
|
||||
pulsar F2).
|
||||
.\"NODE " Directory Tree"
|
||||
@ -1502,7 +1503,7 @@ CDPATH tal y como se describe en
|
||||
.\"LINK2"
|
||||
comando cd interno\&.
|
||||
.\"The cd internal command"
|
||||
.\"NODE " Extension File Edit"
|
||||
.\"NODE " Edit Extension File"
|
||||
.SH " Editar el Archivo de Extensiones"
|
||||
Abre el archivo
|
||||
.I ~/.config/mc/mc.ext
|
||||
@ -1572,7 +1573,7 @@ Nos permite controlar el estado de cualquier proceso de Midnight Commander
|
||||
en segundo plano (solo las operaciones de copiar y mover archivos pueden realizarse
|
||||
en segundo plano). Podemos parar, reiniciar y eliminar procesos en segundo plano desde
|
||||
aquí.
|
||||
.\"NODE " Menu File Edit"
|
||||
.\"NODE " Edit Menu File"
|
||||
.SH " Edición del Archivo de Menú"
|
||||
El menú de usuario es un menú de acciones útiles que puede ser personalizado
|
||||
por el usuario. Cuando accedemos al menú de usuario se utiliza, si existe,
|
||||
@ -2278,7 +2279,7 @@ Commander compara la extensión del archivo seleccionado con las extensiones
|
||||
recogidas en el
|
||||
.\"LINK2"
|
||||
Archivo de Extensiones\&.
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
Si se produce una coincidencia se ejecutará el código asociado con esa extensión.
|
||||
Tendrá lugar una
|
||||
.\"LINK2"
|
||||
@ -2327,11 +2328,11 @@ cualquier lugar del sistema de archivos, usando solo su nombre relativo
|
||||
Cuando se accede al
|
||||
.\"LINK2"
|
||||
menú de usuario\&,
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
o se ejecuta un
|
||||
.\"LINK2"
|
||||
comando dependiente de extensión\&,
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
o se ejecuta un comando desde la línea de entrada de comandos,
|
||||
se realiza una simple sustitución de macro.
|
||||
.PP
|
||||
@ -2823,7 +2824,7 @@ Es posible adiestrar al visor de archivos sobre cómo mostrar un archivo, míres
|
||||
la sección
|
||||
.\"LINK2"
|
||||
Editar Archivo de Extensiones\&.
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
.\"NODE "Internal File Editor"
|
||||
.SH "Editor de Archivos Interno"
|
||||
El editor de archivos interno es un editor a pantalla completa de
|
||||
@ -3002,7 +3003,7 @@ que normalmente basta con apuntar a un archivo tar y pulsar Intro para entrar en
|
||||
archivo tar. Véase la sección
|
||||
.\"LINK2"
|
||||
Edición del Archivo de Extensiones
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
para obtener más detalles sobre cómo hacer esto.
|
||||
.PP
|
||||
Ejemplos:
|
||||
@ -3305,7 +3306,7 @@ Se pueden asociar extensiones o tipos de archivo a un determinado sistema
|
||||
de archivos externo tal como se describe en la sección sobre cómo
|
||||
.\"LINK2"
|
||||
Editar el Archivo de Extensiones
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
de Midnight Commander. He aquí, a modo de ejemplo, una entrada para
|
||||
paquetes Debian:
|
||||
.PP
|
||||
@ -3457,9 +3458,9 @@ El archivo se busca, en orden, de varias maneras:
|
||||
.IP
|
||||
.br
|
||||
1) La opción
|
||||
.B \-S \<skin\>
|
||||
.B \-S <skin>
|
||||
o
|
||||
.B \-\-skin=\<skin\>
|
||||
.B \-\-skin=<skin>
|
||||
al ejecutar mc.
|
||||
.br
|
||||
2) La variable de entorno
|
||||
@ -3909,7 +3910,7 @@ Si esta variable está activada (por defecto lo está) se recurrirá al
|
||||
comando "file" para reconocer los tipos de archivo referidos en el archivo
|
||||
.\"LINK2"
|
||||
mc.ext\&.
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
.TP
|
||||
.I xtree_mode
|
||||
Si esta variable está activada (por defecto no) cuando naveguemos
|
||||
|
@ -1,3 +1,4 @@
|
||||
.\" -*- mode: troff; coding: utf8 -*-
|
||||
.\"TOPICS "Tartalomjegyzék"
|
||||
.TH MC 1 "%DATE_OF_MAN_PAGE%" "MC Version %DISTR_VERSION%" "GNU Midnight Commander"
|
||||
.\"SKIP_SECTION"
|
||||
@ -173,7 +174,7 @@ A fájlra történő dupla kattintásra az MC megpróbálja futtani
|
||||
azt, ha futtatható fájlról van szó; ha a
|
||||
.\"LINK2"
|
||||
fájl kiterjesztését
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
egy adott programhoz már hozzá rendelted, a fájl kiterjesztéséhez
|
||||
hozzárendelt program lefut.
|
||||
.PP
|
||||
@ -278,7 +279,7 @@ panel információit; ha a kiválasztás egy futtatható fájlon van, akkor
|
||||
lefuttatja azt. Végül, ha a kiválasztott fájl kiterjesztése szerepel a
|
||||
.\"LINK2"
|
||||
társításoknál\&,
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
akkor a kijelölt parancs fut le.
|
||||
.PP
|
||||
.B C\-l
|
||||
@ -875,7 +876,7 @@ lenyomására egy teljes listát kapsz az elérhető gombokról.
|
||||
Ez segítségül hívja a
|
||||
.\"LINK2"
|
||||
felhasználói menüt\&.
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
A felhasználói menü könnyű használatot biztosít az új menükkel és az
|
||||
extra eszközökkel a Midnight Commander\-hez.
|
||||
.PP
|
||||
@ -1092,14 +1093,14 @@ tartalmát a jellegi panelbe teszi.
|
||||
A
|
||||
.\"LINK2"
|
||||
Társítások
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
lehetővé teszik számodra a futtatandó programok meghatározását, a
|
||||
kiválasztott fájl kiterjesztésének (fájlnév vége) megfelelően akkor, ha
|
||||
futtatod, megtekinted a tartalmát, átszerkeszted vagy más egyéb dolgot
|
||||
szeretnél vele csinálni. A
|
||||
.\"LINK2"
|
||||
Menu editor edit
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
parancs a felhasználói menü szerkesztésére használható (ami az F2
|
||||
lenyomásával elérhető).
|
||||
.\"NODE " Directory Tree"
|
||||
@ -1296,7 +1297,7 @@ használatát megtekintheted a
|
||||
A cd belső parancs
|
||||
.\"The cd internal command"
|
||||
leírásánál.
|
||||
.\"NODE " Extension File Edit"
|
||||
.\"NODE " Edit Extension File"
|
||||
.SH " Társítások"
|
||||
Ez az ~/.config/mc/mc.ext szerkesztéséhez segítségül fogja hívni a
|
||||
szövegszerkesztődet. A fájl formátuma a következő (a formátum a 3.0\-ás
|
||||
@ -1364,7 +1365,7 @@ Ezzel szabályozhatod néhány Commander háttérfolyamat állapotát (csak a
|
||||
másolás és a mozgatás fájlműveletek tehetők háttérbe). Ezeket a
|
||||
háttérmunkákat állíthatod le, indíthatod újra, lőheted ki itt. A
|
||||
linuxban futó background processzekre hatástalan.
|
||||
.\"NODE " Menu File Edit"
|
||||
.\"NODE " Edit Menu File"
|
||||
.SH " Menü szerkesztés"
|
||||
A felhasználói menüt a felhasználó testre szabhatja. Ez az aktulis
|
||||
könyvtár .mc.menu fájlja, ha az létezik, de csak, ha az a felhasználó
|
||||
@ -1919,7 +1920,7 @@ Ha az Enter\-t az adott fájl felett lenyomod, nem indul el azonnal, hanem
|
||||
a Midnight Commander leellenőrzi a kiválasztott fájl kiterjesztését a
|
||||
.\"LINK2"
|
||||
Társításokban
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
találhatónak megfelelően. Ha talál egyezést, akkor a kódnak megfelelő
|
||||
bejegyzést futtatja. Egy nagyon egyszerű
|
||||
.\"LINK2"
|
||||
@ -1966,11 +1967,11 @@ az /usr/src/linux könyvtárba léptet át).
|
||||
Amikor belépsz a
|
||||
.\"LINK2"
|
||||
felhasználói menübe\&,
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
vagy a
|
||||
.\"LINK2"
|
||||
társítások parancsot\&,
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
futtatod, illetve a parancsot a parancssorból futtatod, a Makró
|
||||
Helyettesítőt használod.
|
||||
.PP
|
||||
@ -2439,7 +2440,7 @@ Ez a rész a fájl fájlnézővel történő megjelenítésének leírását
|
||||
tartalmazta, lásd még a
|
||||
.\"LINK2"
|
||||
Társítások
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
részt.
|
||||
.\"NODE "Internal File Editor"
|
||||
.SH "Belső fájlszerkesztő"
|
||||
@ -2667,7 +2668,7 @@ csak rá kell mutatnod a tar fájlra és le kell nyomnod az entert ahhoz,
|
||||
hogy beléphess a tar fájlba, ehhez nézd meg a
|
||||
.\"LINK2"
|
||||
Társítások
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
részt, hogy megismerhesd az ezzel kapcsolatos információkat:
|
||||
.PP
|
||||
Példák:
|
||||
@ -2881,8 +2882,8 @@ where xxxx is one of:
|
||||
.PP
|
||||
You could bind file type/extension to specified extfs as described in the
|
||||
.\"LINK2"
|
||||
Extension File Edit
|
||||
.\"Extension File Edit"
|
||||
Edit Extension File
|
||||
.\"Edit Extension File"
|
||||
section. Here is an example entry for Debian packages:
|
||||
.PP
|
||||
.nf
|
||||
@ -3118,7 +3119,7 @@ Ha ez a változó be van állítva (alapértelmezésben) meg foja jelölni azt
|
||||
a fájl parancsot, amelyhez a
|
||||
.\"LINK2"
|
||||
Társításokban
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
a fájl típusnál egyezőt talált.
|
||||
.PP
|
||||
.I xtree_mode
|
||||
|
@ -1,3 +1,4 @@
|
||||
.\" -*- mode: troff; coding: utf8 -*-
|
||||
.\" Tradotto dal 15 agosto 2002 da
|
||||
.\" Marco Ciampa <ciampix@libero.it>
|
||||
.\" Chi vuole contribuire aggiunga il nome qui sotto.
|
||||
@ -192,7 +193,7 @@ Se il file è un programma eseguibile, il doppio clic su di esso lo eseguirà
|
||||
altrimenti se il
|
||||
.\"LINK2"
|
||||
file estensioni
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
ha un programma specifico per quell'estensione del file, il suddetto programma
|
||||
verrà eseguito.
|
||||
.PP
|
||||
@ -298,7 +299,7 @@ Per ultimo, se l'estensione del file selezionato corrisponde ad una
|
||||
delle estensioni presenti nel
|
||||
.\"LINK2"
|
||||
file estensioni\&,
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
il comando corrispondente viene eseguito.
|
||||
.TP
|
||||
.B C\-l
|
||||
@ -898,7 +899,7 @@ nuovamente per ottenere la lista completa dei tasti accettati.
|
||||
Invoca il
|
||||
.\"LINK2"
|
||||
menu utente\&.
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
Il menu utente fornisce un modo semplice per dare agli utenti un menu ed
|
||||
aggiungere nuove funzionalità al Midnight Commander.
|
||||
.PP
|
||||
@ -1114,14 +1115,14 @@ corrente.
|
||||
Il comando
|
||||
.\"LINK2"
|
||||
modifica file estensioni
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
permette di specificare i programmi che devono essere eseguiti quando
|
||||
si prova ad eseguire, visualizzare, modificare e un mucchio di altre
|
||||
cose, file con una specifica estensione (la fine del nome del file).
|
||||
Il comando
|
||||
.\"LINK2"
|
||||
modifica file menu
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
serve a modificare il menu utente (che appare premendo F2).
|
||||
.\"NODE " Directory Tree"
|
||||
.SH " Albero directory"
|
||||
@ -1310,7 +1311,7 @@ variabile CDPATH come descritto in
|
||||
.\"LINK2"
|
||||
comando cd interno\&.
|
||||
.\"The cd internal command"
|
||||
.\"NODE " Extension File Edit"
|
||||
.\"NODE " Edit Extension File"
|
||||
.SH " Modifica file estensioni"
|
||||
Questo comando invocherà l'editor sul file
|
||||
.IR ~/.config/mc/mc.ext .
|
||||
@ -1373,7 +1374,7 @@ Questo comando permette di controllare lo stato di ogni processo
|
||||
in background del Midnight Commander (in background possono essere
|
||||
eseguite solo operazioni di copia e rinomina). Da qui si può bloccare,
|
||||
far ripartire e uccidere un lavoro in background.
|
||||
.\"NODE " Menu File Edit"
|
||||
.\"NODE " Edit Menu File"
|
||||
.SH " Modifica file menu"
|
||||
Il menu utente è un menu di comandi utili che possono essere
|
||||
personalizzati dall'utente. Quando si accede al menu utente, viene
|
||||
@ -1954,7 +1955,7 @@ Commander confronta l'estensione del file selezionato con ciò
|
||||
che trova nel
|
||||
.\"LINK2"
|
||||
file estensioni\&.
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
Se viene trovata una corrispondenza, verrà eseguito il codice associato.
|
||||
Verrà eseguita una semplice
|
||||
.\"LINK2"
|
||||
@ -2002,11 +2003,11 @@ parte nel file system (per esempio cd linux vi porterà in
|
||||
Quando si accede ad un
|
||||
.\"LINK2"
|
||||
menu utente\&,
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
o si esegue un
|
||||
.\"LINK2"
|
||||
comando dipendente dall'estensione\&,
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
o si esegue un comando dalla riga di ingresso,
|
||||
viene eseguita una semplice sostituzione di macro.
|
||||
.PP
|
||||
@ -2476,7 +2477,7 @@ E' anche possibile istruire il visualizzatore su come mostrare un file,
|
||||
vedere la sezione
|
||||
.\"LINK2"
|
||||
modifica file estensioni\&.
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
.\"NODE "Internal File Editor"
|
||||
.SH "Editor di file interno"
|
||||
L'editor di file interno fornisce molte delle funzioni dei più
|
||||
@ -2678,7 +2679,7 @@ significa che normalmente basta selezionare un file tar e premere invio
|
||||
per entrare nel file tar, vedere la sezione
|
||||
.\"LINK2"
|
||||
modifica file estensioni
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
per i dettagli su come questo viene fatto.
|
||||
.PP
|
||||
Esempi:
|
||||
@ -2887,8 +2888,8 @@ where xxxx is one of:
|
||||
.PP
|
||||
You could bind file type/extension to specified extfs as described in the
|
||||
.\"LINK2"
|
||||
Extension File Edit
|
||||
.\"Extension File Edit"
|
||||
Edit Extension File
|
||||
.\"Edit Extension File"
|
||||
section. Here is an example entry for Debian packages:
|
||||
.PP
|
||||
.nf
|
||||
@ -3113,7 +3114,7 @@ Se questa variabile è abilitata (valore predefinito) userà il comando
|
||||
file per trovare delle corrispondenze sui tipi di file elencati nel
|
||||
.\"LINK2"
|
||||
file mc.ext\&.
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
.TP
|
||||
.I xtree_mode
|
||||
Se questa variabile è impostata (il valore predefinito è no) quando
|
||||
|
@ -1,3 +1,4 @@
|
||||
.\" -*- mode: troff; coding: utf8 -*-
|
||||
.\"TOPICS "Topics:"
|
||||
.TH MC 1 "%DATE_OF_MAN_PAGE%" "MC Version %DISTR_VERSION%" "GNU Midnight Commander"
|
||||
.\"SKIP_SECTION"
|
||||
@ -236,7 +237,7 @@ Double\-clicking on a file will try to execute the command if it is
|
||||
an executable program; and if the
|
||||
.\"LINK2"
|
||||
extension file
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
has a program specified for the file's extension, the specified
|
||||
program is executed.
|
||||
.PP
|
||||
@ -338,9 +339,9 @@ User\-defined keymap\-file is searched on the following algorithm (to the first
|
||||
.IP
|
||||
.br
|
||||
1) command line option
|
||||
.B \-K \<keymap\>
|
||||
.B \-K <keymap>
|
||||
or
|
||||
.B \-\-keymap=\<keymap\>
|
||||
.B \-\-keymap=<keymap>
|
||||
.br
|
||||
2) Environment variable
|
||||
.B MC_KEYMAP
|
||||
@ -385,7 +386,7 @@ if the extension of the selected file name matches one of the
|
||||
extensions in the
|
||||
.\"LINK2"
|
||||
extensions file
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
then the corresponding command is executed.
|
||||
.TP
|
||||
.B C\-l
|
||||
@ -1016,7 +1017,7 @@ list of accepted keys.
|
||||
Invoke the
|
||||
.\"LINK2"
|
||||
user menu\&.
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
The user menu provides an easy way to provide users with a menu and
|
||||
add extra features to the Midnight Commander.
|
||||
.PP
|
||||
@ -1293,15 +1294,15 @@ internal editors, viewers and other MC modules that support this mode.
|
||||
The
|
||||
.\"LINK2"
|
||||
"Edit extension file"
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
command allows you to specify programs to executed when you try to
|
||||
execute, view, edit and do a bunch of other thing on files
|
||||
with certain extensions (filename endings).
|
||||
.PP
|
||||
The
|
||||
.\"LINK2"
|
||||
"Edit menu file"
|
||||
.\"Menu File Edit"
|
||||
"Edit Menu File"
|
||||
.\"Edit Menu File"
|
||||
command may be used for editing the user menu (which appears by
|
||||
pressing F2).
|
||||
.\"NODE " Directory Tree"
|
||||
@ -1491,8 +1492,8 @@ CDPATH variable as described in
|
||||
internal cd command
|
||||
.\"The cd internal command"
|
||||
description.
|
||||
.\"NODE " Extension File Edit"
|
||||
.SH " Extension File Edit"
|
||||
.\"NODE " Edit Extension File"
|
||||
.SH " Edit Extension File"
|
||||
This will invoke your editor on the file
|
||||
.IR ~/.config/mc/mc.ext .
|
||||
The format of this file following:
|
||||
@ -1581,8 +1582,8 @@ This lets you control the state of any background Midnight Commander
|
||||
process (only copy and move files operations can be done in the
|
||||
background). You can stop, restart and kill a background job from
|
||||
here.
|
||||
.\"NODE " Menu File Edit"
|
||||
.SH " Menu File Edit"
|
||||
.\"NODE " Edit Menu File"
|
||||
.SH " Edit Menu File"
|
||||
The user menu is a menu of useful actions that can be customized by
|
||||
the user. When you access the user menu, the
|
||||
file .mc.menu from the current directory is used if it exists,
|
||||
@ -2282,7 +2283,7 @@ Commander checks the extension of the selected file against the
|
||||
extensions in the
|
||||
.\"LINK2"
|
||||
Extensions File\&.
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
If a match is found then the code associated with that extension is
|
||||
executed. A very simple
|
||||
.\"LINK2"
|
||||
@ -2330,11 +2331,11 @@ cd linux could take you to /usr/src/linux).
|
||||
When accessing a
|
||||
.\"LINK2"
|
||||
user menu\&,
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
or executing an
|
||||
.\"LINK2"
|
||||
extension dependent command\&,
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
or running a command from the command line input, a simple macro
|
||||
substitution takes place.
|
||||
.PP
|
||||
@ -2770,13 +2771,13 @@ Toggle show of line numbers.
|
||||
.B f
|
||||
Maximize left panel.
|
||||
.PP
|
||||
.B \=
|
||||
.B =
|
||||
Make panels equal in width.
|
||||
.PP
|
||||
.B \>
|
||||
.B >
|
||||
Reduce the size of the right panel.
|
||||
.PP
|
||||
.B \<
|
||||
.B <
|
||||
Reduce the size of the left panel.
|
||||
.PP
|
||||
.B c
|
||||
@ -2938,8 +2939,8 @@ selection dialog.
|
||||
It's possible to instruct the file viewer how to display a file, look
|
||||
at the
|
||||
.\"LINK2"
|
||||
Extension File Edit section
|
||||
.\"Extension File Edit"
|
||||
Edit Extension File section
|
||||
.\"Edit Extension File"
|
||||
|
||||
.\"NODE "Internal File Editor"
|
||||
.SH "Internal File Editor"
|
||||
@ -3202,8 +3203,8 @@ The mc.ext file already provides a shortcut for tar files, this means
|
||||
that usually you just point to a tar file and press return to enter
|
||||
into the tar file, see the
|
||||
.\"LINK2"
|
||||
Extension File Edit
|
||||
.\"Extension File Edit"
|
||||
Edit Extension File
|
||||
.\"Edit Extension File"
|
||||
section for details on how this is done.
|
||||
.PP
|
||||
Examples:
|
||||
@ -3453,8 +3454,8 @@ where xxxx is one of:
|
||||
.PP
|
||||
You could bind file type/extension to specified extfs as described in the
|
||||
.\"LINK2"
|
||||
Extension File Edit
|
||||
.\"Extension File Edit"
|
||||
Edit Extension File
|
||||
.\"Edit Extension File"
|
||||
section. Here is an example entry for Debian packages:
|
||||
.PP
|
||||
.nf
|
||||
@ -3612,9 +3613,9 @@ A skin\-file is searched on the following algorithm (to the first one found):
|
||||
.IP
|
||||
.br
|
||||
1) command line option
|
||||
.B \-S \<skin\>
|
||||
.B \-S <skin>
|
||||
or
|
||||
.B \-\-skin=\<skin\>
|
||||
.B \-\-skin=<skin>
|
||||
.br
|
||||
2) Environment variable
|
||||
.B MC_SKIN
|
||||
@ -4068,7 +4069,7 @@ If this variable is on (the default) it will spawn the file command to
|
||||
match the file types listed on the
|
||||
.\"LINK2"
|
||||
mc.ext file\&.
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
.TP
|
||||
.I xtree_mode
|
||||
If this variable is on (default is off) when you browse the file system
|
||||
|
@ -137,7 +137,7 @@ where
|
||||
.B XXXX
|
||||
is the number from 0 to 9999.
|
||||
See
|
||||
.B Menu File Edit
|
||||
.B Edit Menu File
|
||||
for more detail about format of the script.
|
||||
.PP
|
||||
Following macro definition and directives can be used:
|
||||
|
@ -1,3 +1,4 @@
|
||||
.\" -*- mode: troff; coding: utf8 -*-
|
||||
.\"Przetłumaczone przez by Macieja Wojciechowskiego wojciech@staszic.waw.pl
|
||||
.TH MC 1 "%DATE_OF_MAN_PAGE%" "MC Version %DISTR_VERSION%" "GNU Midnight Commander"
|
||||
.\"SKIP_SECTION"
|
||||
@ -910,9 +911,9 @@ Komenda panelu zewnętrznego (External panelize) pozwala na wykonywania program
|
||||
zewnętrznych i ustawienia zawartości paneli na to co zwróciła wywołana
|
||||
komenda.
|
||||
.PP
|
||||
Komenda edycji rozszerzeń plików (Extension file edit) pozwala na własny wybór
|
||||
Komenda edycji rozszerzeń plików (Edit Extension File) pozwala na własny wybór
|
||||
programów, które mają być używane do wykonywania plików z podanymi
|
||||
rozszerzeniami. Komenda edycji pliku menu (Menu file edit) może być używana do
|
||||
rozszerzeniami. Komenda edycji pliku menu (Edit Menu File) może być używana do
|
||||
edytowania menu użytkownika (tego, które pojawia się po naciśnięciu kombinacji
|
||||
F2).
|
||||
.PP
|
||||
@ -1092,8 +1093,8 @@ Powoduje to przechodzenie do częściej przeglądanych katalogów znacznie szybc
|
||||
Możesz używać ciągle wartości CDPATH opisanej w sekcji Wewnętrzne
|
||||
przemieszczanie.
|
||||
.PP
|
||||
.\"NODE " Extension File Edit"
|
||||
.SH " Edycja rozszerzeń pliów (Extension File Edit)"
|
||||
.\"NODE " Edit Extension File"
|
||||
.SH " Edycja rozszerzeń pliów (Edit Extension File)"
|
||||
Ta komenda wywoła twój edytor na plik ~/.config/mc/mc.ext. Format tego pliku jest
|
||||
następujący (zmienił się on począwszy od wersji 3.0):
|
||||
.PP
|
||||
@ -1161,8 +1162,8 @@ przez Midnight Commandera (tylko operacje kopiowania i przenoszenia, mogą
|
||||
być wykonywane w tle). Z tego menu możesz zastopować, zresetować i "zabić"
|
||||
proces w tle.
|
||||
.PP
|
||||
.\"NODE " Menu File Edit"
|
||||
.SH " Edycja menu użytkownika (Menu File Edit)"
|
||||
.\"NODE " Edit Menu File"
|
||||
.SH " Edycja menu użytkownika (Edit Menu File)"
|
||||
Menu użytkownika jest bardzo użytecznym menu, które może być tworzone
|
||||
w sposób dowolny, przez użytkownika. Kiedy tylko próbujesz coś zrobić
|
||||
przy użyciu tego menu, ładowany jest plik .mc.menu z aktualnego katalogu, ale
|
||||
@ -2510,8 +2511,8 @@ where xxxx is one of:
|
||||
.PP
|
||||
You could bind file type/extension to specified extfs as described in the
|
||||
.\"LINK2"
|
||||
Extension File Edit
|
||||
.\"Extension File Edit"
|
||||
Edit Extension File
|
||||
.\"Edit Extension File"
|
||||
section. Here is an example entry for Debian packages:
|
||||
.PP
|
||||
.nf
|
||||
|
@ -1,3 +1,4 @@
|
||||
.\" -*- mode: troff; coding: utf8 -*-
|
||||
.\"TOPICS "Разделы помощи:"
|
||||
.\" TODO: Перевести раздел EXTernal File System
|
||||
.TH MC 1 "%DATE_OF_MAN_PAGE%" "MC Version %DISTR_VERSION%" "GNU Midnight Commander"
|
||||
@ -224,7 +225,7 @@ Commander, просто набрав имя этой команды (прогр
|
||||
исполнение (если это исполняемая программа); либо, если
|
||||
.\"LINK2"
|
||||
файл расширений
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
содержит программу, ассоциированную с данным расширением, запускается
|
||||
эта программа и ей передается на обработку выбранный файл.
|
||||
.PP
|
||||
@ -331,9 +332,9 @@ S\-<символ> означает, что нужно держать в нажа
|
||||
.IP
|
||||
.br
|
||||
1) параметр командной строки
|
||||
.B \-K \<файл\>
|
||||
.B \-K <файл>
|
||||
или
|
||||
.B \-\-keymap=\<файл\>
|
||||
.B \-\-keymap=<файл>
|
||||
.br
|
||||
2) переменная окружения
|
||||
.B MC_KEYMAP
|
||||
@ -381,7 +382,7 @@ S\-<символ> означает, что нужно держать в нажа
|
||||
из расширений, указанных в
|
||||
.\"LINK2"
|
||||
файле расширений\&,
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
то выполняется команда, связанная с этим расширением.
|
||||
.TP
|
||||
.B C\-l
|
||||
@ -1265,7 +1266,7 @@ cd\&.
|
||||
Вызывает
|
||||
.\"LINK2"
|
||||
меню пользователя\&.
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
Меню пользователя предоставляет простой способ расширения возможностей
|
||||
Midnight Commander за счет добавления в личное меню пользователя вызова
|
||||
часто используемых программ.
|
||||
@ -1366,7 +1367,7 @@ Midnight Commander за счет добавления в личное меню
|
||||
После выбора пункта меню
|
||||
.\"LINK2"
|
||||
.I "Файл расширений"
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
вы можете связать с определенным расширением файла (окончанием имени
|
||||
после последней точки) программу, которая будет запускаться для
|
||||
обработки (просмотра, редактирования или выполнения) файла с таким
|
||||
@ -1376,7 +1377,7 @@ Midnight Commander за счет добавления в личное меню
|
||||
Пункт меню
|
||||
.\"LINK2"
|
||||
.I "Файл меню"
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
используется для редактирования пользовательского меню (которое
|
||||
появляется после нажатия клавиши F2).
|
||||
.\"NODE " Directory Tree"
|
||||
@ -1590,7 +1591,7 @@ CDPATH (смотрите описание
|
||||
.\"LINK2"
|
||||
встроенной команды cd\&.
|
||||
.\"The cd internal command"
|
||||
.\"NODE " Extension File Edit"
|
||||
.\"NODE " Edit Extension File"
|
||||
.SH " Файл расширений"
|
||||
Этот пункт меню "Команда" служит для вызова редактора и редактирования
|
||||
файла
|
||||
@ -1674,7 +1675,7 @@ View из второй секции. default должно описывать в
|
||||
"горячие" клавиши
|
||||
.B C\-x j,
|
||||
вы можете остановить, возобновить или снять любое из фоновых заданий.
|
||||
.\"NODE " Menu File Edit"
|
||||
.\"NODE " Edit Menu File"
|
||||
.SH " Редактирование файлов меню"
|
||||
Файлы меню содержат списки команд для выполнения часто повторяемых
|
||||
пользователем операций. Эти меню создаются и поддерживаются самими
|
||||
@ -2468,7 +2469,7 @@ FTP\-сервера, в памяти (в кеше). Время, в течени
|
||||
расширение выбранного файла с расширениями, прописанными в
|
||||
.\"LINK2"
|
||||
файле расширений\&.
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
Если в файле расширений найдется подраздел, задающий процедуры обработки
|
||||
файлов с данным расширением, то обработка файла производится в
|
||||
соответствии с заданными в этом подразделе командами. Перед обработкой
|
||||
@ -2523,11 +2524,11 @@ FTP\-сервера, в памяти (в кеше). Время, в течени
|
||||
Перед выполнением команд, задаваемых пунктами
|
||||
.\"LINK2"
|
||||
пользовательского меню\&,
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
вызываемых
|
||||
.\"LINK2"
|
||||
по расширению имени файла\&,
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
или запускаемых из командной строки ввода, вначале выполняются простые
|
||||
макроподстановки.
|
||||
.PP
|
||||
@ -3033,13 +3034,13 @@ mcdiff \- это встроенное средство для сравнения
|
||||
.B f
|
||||
Увеличить левую панель до максимума.
|
||||
.PP
|
||||
.B \=
|
||||
.B =
|
||||
Сделать панели равными по ширине.
|
||||
.PP
|
||||
.B \>
|
||||
.B >
|
||||
Увеличить левую панель.
|
||||
.PP
|
||||
.B \<
|
||||
.B <
|
||||
Увеличить правую панель.
|
||||
.PP
|
||||
.B c
|
||||
@ -3217,7 +3218,7 @@ ASCII и шестнадцатеричный (hex). Для переключени
|
||||
просмотра, воспользовавшись
|
||||
.\"LINK2"
|
||||
файлом расширений\&.
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
|
||||
.\"NODE "Internal File Editor"
|
||||
.SH "Встроенный редактор"
|
||||
@ -3562,7 +3563,7 @@ tar\-файлов, то есть обычно для получения спис
|
||||
Enter. Чтобы понять, как это достигается, смотрите раздел
|
||||
.\"LINK2"
|
||||
Файл расширений\&.
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
.PP
|
||||
Примеры:
|
||||
.PP
|
||||
@ -3816,7 +3817,7 @@ or
|
||||
Вы можете назначить ВФС файлах по типу или расширению в секции
|
||||
.\"LINK2"
|
||||
Файл расширений
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
Например, для обработки пакетов Debian внесите:
|
||||
.PP
|
||||
.nf
|
||||
@ -4005,9 +4006,9 @@ menuhotsel=yellow;black;bold+underline
|
||||
.IP
|
||||
.br
|
||||
1) параметр командной строки
|
||||
.B \-S \<скин\>
|
||||
.B \-S <скин>
|
||||
или
|
||||
.B \-\-skin=\<скин\>
|
||||
.B \-\-skin=<скин>
|
||||
.br
|
||||
2) переменная окружения
|
||||
.B MC_SKIN
|
||||
@ -4456,7 +4457,7 @@ Home и End в активной панели. Вместо того, чтобы
|
||||
для определения типа файла в соответствии с типами файлов, указанными в файле
|
||||
.\"LINK2"
|
||||
mc.ext\&.
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
.PP
|
||||
.I xtree_mode
|
||||
.IP
|
||||
|
@ -1,3 +1,4 @@
|
||||
.\" -*- mode: troff; coding: utf8 -*-
|
||||
.\"TOPICS "Теме:"
|
||||
.TH ПН 1 "%DATE_OF_MAN_PAGE%" "ПН верзија %DISTR_VERSION%" "ГНУ\-ов поноћни наредник"
|
||||
.\"SKIP_SECTION"
|
||||
@ -169,7 +170,7 @@ xterm\-capable terminals (tmux/screen).
|
||||
ради о извршном програму; а ако је у
|
||||
.\"LINK2"
|
||||
датотеци врста
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
задан програм за врсту те датотеке, тај програм ће бити извршен.
|
||||
.PP
|
||||
Такође је могуће извршавати наредбе додељене натписима функцијских
|
||||
@ -272,7 +273,7 @@ xterm\-capable terminals (tmux/screen).
|
||||
крају, ако се врста означене датотеке поклапа са једном од врста из
|
||||
.\"LINK2"
|
||||
датотеке врста\&,
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
онда се извршава одговарајућа наредба.
|
||||
.TP
|
||||
.B C\-l
|
||||
@ -865,7 +866,7 @@ half name | size:7 | type mode:3
|
||||
Покреће
|
||||
.\"LINK2"
|
||||
кориснички мени\&.
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
Кориснички мени пружа лак начин да се корисницима понуди мени и додаје
|
||||
посебне одлике Поноћном нареднику.
|
||||
.PP
|
||||
@ -1075,14 +1076,14 @@ file may be preallocated relative to preallocate_space configure option.
|
||||
Наредба
|
||||
.\"LINK2"
|
||||
Уреди датотеку врста
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
вам омогућава да задате програме који се извршавају када покушате да
|
||||
извршите, прегледате, уређујете или радите прегршт других ствари над
|
||||
датотекама извесних врста (наставака назива датотека после тачке).
|
||||
Наредба
|
||||
.\"LINK2"
|
||||
Уреди датотеку менија
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
се може користити за уређивање корисничког менија (који се појављује
|
||||
притиском на тастер F2).
|
||||
.\"NODE " Directory Tree"
|
||||
@ -1278,7 +1279,7 @@ awk '$9 ~! /incoming/ { print $9 }' < /var/log/xferlog
|
||||
.\"LINK2"
|
||||
наредбе уграђена пром.дир.
|
||||
.\"The cd internal command"
|
||||
.\"NODE " Extension File Edit"
|
||||
.\"NODE " Edit Extension File"
|
||||
.SH " Уреди датотеку врста"
|
||||
Ово покреће ваш уређивач над датотеком
|
||||
.IR ~/.config/mc/mc.ext .
|
||||
@ -1365,7 +1366,7 @@ awk '$9 ~! /incoming/ { print $9 }' < /var/log/xferlog
|
||||
Поноћног наредника (за сада се у позадини могу обављати само копирање
|
||||
и премештање датотека). Одавде можете да заустављате, поново покрећете
|
||||
и убијате позадинске послове.
|
||||
.\"NODE " Menu File Edit"
|
||||
.\"NODE " Edit Menu File"
|
||||
.SH " Уреди датотеку менија"
|
||||
Кориснички мени је мени корисних радњи кога корисник може
|
||||
прилагођавати. Када приступите корисничком менију, користи се
|
||||
@ -1939,7 +1940,7 @@ ftpfs чува списак директоријума који добавља
|
||||
Поноћни наредник ће упоредити врсту изабране датотеке са врстама из
|
||||
.\"LINK2"
|
||||
датотеке врста\&.
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
Ако је пронађена врста која одговара траженој, онда ће се извршити код
|
||||
придружен тој врсти. Пре извршења наредбе врши се веома једноставно
|
||||
.\"LINK2"
|
||||
@ -1987,11 +1988,11 @@ linux би вас одвело у /usr/src/linux).
|
||||
Приликом приступа
|
||||
.\"LINK2"
|
||||
корисничком менију\&,
|
||||
.\"Menu File Edit"
|
||||
.\"Edit Menu File"
|
||||
извршења
|
||||
.\"LINK2"
|
||||
наредбе зависне од врсте\&,
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
или покретања наредбе из уноса наредбеног реда, врши се једноставна
|
||||
замена макроа.
|
||||
.PP
|
||||
@ -2466,7 +2467,7 @@ linux би вас одвело у /usr/src/linux).
|
||||
погледајте одељак
|
||||
.\"LINK2"
|
||||
уређивање датотеке врста\&.
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
.\"NODE "Internal File Editor"
|
||||
.SH "Уграђени уређивач датотека"
|
||||
Уграђени уређивач датотека је моћан екрански уређивач. Он може да
|
||||
@ -2687,7 +2688,7 @@ if the
|
||||
`Return' или `Enter' да бисте ушли у њу; погледајте одељак
|
||||
.\"LINK2"
|
||||
Уређивање датотеке врста
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
за детаље како да ово обавите.
|
||||
.PP
|
||||
Примери:
|
||||
@ -2907,7 +2908,7 @@ CD\-овима) или `apt' (списак свих Дебијанових па
|
||||
датотека, као што је то описано у одељку
|
||||
.\"LINK2"
|
||||
уређивање датотеке врста\&.
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
Ево примера ставке за Дебијанове пакете:
|
||||
.PP
|
||||
.nf
|
||||
@ -3127,7 +3128,7 @@ base_color=normal=white,default:marked=magenta,default
|
||||
наредбу `file' за одређивање врсте датотека које су задане у
|
||||
.\"LINK2"
|
||||
датотеци `mc.ext'\&.
|
||||
.\"Extension File Edit"
|
||||
.\"Edit Extension File"
|
||||
.TP
|
||||
.I xtree_mode
|
||||
Уколико је ова променљива укључена (подразумевано је искључена),
|
||||
|
@ -136,7 +136,7 @@
|
||||
#define UTF8_CHAR_LEN 6
|
||||
|
||||
/* Used to distinguish between a normal MC termination and */
|
||||
/* one caused by typing `exit' or `logout' in the subshell */
|
||||
/* one caused by typing 'exit' or 'logout' in the subshell */
|
||||
#define SUBSHELL_EXIT 128
|
||||
|
||||
/* C++ style type casts */
|
||||
|
12
lib/search.h
12
lib/search.h
@ -13,8 +13,11 @@
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
typedef int (*mc_search_fn) (const void *user_data, gsize char_offset, int *current_char);
|
||||
typedef int (*mc_update_fn) (const void *user_data, gsize char_offset);
|
||||
typedef enum mc_search_cbret_t mc_search_cbret_t;
|
||||
|
||||
typedef mc_search_cbret_t (*mc_search_fn) (const void *user_data, gsize char_offset,
|
||||
int *current_char);
|
||||
typedef mc_search_cbret_t (*mc_update_fn) (const void *user_data, gsize char_offset);
|
||||
|
||||
#define MC_SEARCH__NUM_REPLACE_ARGS 64
|
||||
|
||||
@ -44,14 +47,13 @@ typedef enum
|
||||
MC_SEARCH_T_GLOB
|
||||
} mc_search_type_t;
|
||||
|
||||
typedef enum
|
||||
enum mc_search_cbret_t
|
||||
{
|
||||
MC_SEARCH_CB_OK = 0,
|
||||
MC_SEARCH_CB_INVALID = -1,
|
||||
MC_SEARCH_CB_ABORT = -2,
|
||||
MC_SEARCH_CB_SKIP = -3
|
||||
} mc_search_cbret_t;
|
||||
|
||||
};
|
||||
|
||||
/*** structures declarations (and typedefs of structures)*****************************************/
|
||||
|
||||
|
@ -306,7 +306,7 @@ mc_search_types_list_get (size_t * num)
|
||||
{
|
||||
/* don't count last NULL item */
|
||||
if (num != NULL)
|
||||
*num = sizeof (mc_search__list_types) / sizeof (mc_search__list_types[0]) - 1;
|
||||
*num = G_N_ELEMENTS (mc_search__list_types) - 1;
|
||||
|
||||
return mc_search__list_types;
|
||||
}
|
||||
|
@ -25,8 +25,9 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "lib/strutil.h"
|
||||
#include "lib/global.h"
|
||||
#include "lib/strescape.h"
|
||||
#include "lib/strutil.h"
|
||||
|
||||
/*** global variables ****************************************************************************/
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
Functions for escaping and unescaping strings
|
||||
|
||||
Copyright (C) 2009, 2011
|
||||
Copyright (C) 2009, 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
@ -26,6 +26,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "lib/global.h"
|
||||
#include "lib/strescape.h"
|
||||
|
||||
/*** global variables ****************************************************************************/
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
Common strings utilities
|
||||
|
||||
Copyright (C) 2007, 2011
|
||||
Copyright (C) 2007, 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
@ -21,16 +21,14 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <langinfo.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "lib/global.h"
|
||||
#include "lib/strutil.h"
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
8bit strings utilities
|
||||
|
||||
Copyright (C) 2007, 2011
|
||||
Copyright (C) 2007, 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
@ -24,9 +24,9 @@
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "lib/global.h"
|
||||
#include "lib/strutil.h"
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
ASCII strings utilities
|
||||
|
||||
Copyright (C) 2007, 2011
|
||||
Copyright (C) 2007, 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
@ -22,12 +22,12 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <config.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "lib/global.h"
|
||||
#include "lib/strutil.h"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
UTF-8 strings utilities
|
||||
|
||||
Copyright (C) 2007, 2011
|
||||
Copyright (C) 2007, 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
@ -24,10 +24,8 @@
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <glib.h>
|
||||
#include <langinfo.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -5,13 +5,9 @@
|
||||
#ifdef USE_NCURSES
|
||||
#ifdef HAVE_NCURSES_CURSES_H
|
||||
#include <ncurses/curses.h>
|
||||
#elif HAVE_NCURSES_NCURSES_H
|
||||
#elif HAVE_NCURSES_NCURSES_H || HAVE_NCURSESW_CURSES_H
|
||||
#include <ncurses/ncurses.h>
|
||||
#elif HAVE_NCURSESW_CURSES_H
|
||||
#include <ncursesw/curses.h>
|
||||
#elif HAVE_NCURSES_HCURSES_H
|
||||
#include <ncurses.h>
|
||||
#elif HAVE_NCURSES_H
|
||||
#elif HAVE_NCURSES_HCURSES_H || HAVE_NCURSES_H
|
||||
#include <ncurses.h>
|
||||
#else
|
||||
#include <curses.h>
|
||||
|
19
lib/util.c
19
lib/util.c
@ -2,7 +2,7 @@
|
||||
Various utilities
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003,
|
||||
2004, 2005, 2007, 2009, 2011
|
||||
2004, 2005, 2007, 2009, 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
@ -11,6 +11,7 @@
|
||||
Dugan Porter, 1994, 1995, 1996
|
||||
Jakub Jelinek, 1994, 1995, 1996
|
||||
Mauricio Plaza, 1994, 1995, 1996
|
||||
Slava Zanko <slavazanko@gmail.com>, 2013
|
||||
|
||||
This file is part of the Midnight Commander.
|
||||
|
||||
@ -116,7 +117,7 @@ resolve_symlinks (const vfs_path_t * vpath)
|
||||
if (vpath->relative)
|
||||
return NULL;
|
||||
|
||||
p = p2 = vfs_path_to_str (vpath);
|
||||
p = p2 = g_strdup (vfs_path_as_str (vpath));
|
||||
r = buf = g_malloc (MC_MAXPATHLEN);
|
||||
buf2 = g_malloc (MC_MAXPATHLEN);
|
||||
*r++ = PATH_SEP;
|
||||
@ -1098,7 +1099,6 @@ load_file_position (const vfs_path_t * filename_vpath, long *line, long *column,
|
||||
FILE *f;
|
||||
char buf[MC_MAXPATHLEN + 100];
|
||||
const size_t len = vfs_path_len (filename_vpath);
|
||||
char *filename;
|
||||
|
||||
/* defaults */
|
||||
*line = 1;
|
||||
@ -1115,7 +1115,6 @@ load_file_position (const vfs_path_t * filename_vpath, long *line, long *column,
|
||||
/* prepare array for serialized bookmarks */
|
||||
if (bookmarks != NULL)
|
||||
*bookmarks = g_array_sized_new (FALSE, FALSE, sizeof (size_t), MAX_SAVED_BOOKMARKS);
|
||||
filename = vfs_path_to_str (filename_vpath);
|
||||
|
||||
while (fgets (buf, sizeof (buf), f) != NULL)
|
||||
{
|
||||
@ -1123,7 +1122,7 @@ load_file_position (const vfs_path_t * filename_vpath, long *line, long *column,
|
||||
gchar **pos_tokens;
|
||||
|
||||
/* check if the filename matches the beginning of string */
|
||||
if (strncmp (buf, filename, len) != 0)
|
||||
if (strncmp (buf, vfs_path_as_str (filename_vpath), len) != 0)
|
||||
continue;
|
||||
|
||||
/* followed by single space */
|
||||
@ -1175,7 +1174,6 @@ load_file_position (const vfs_path_t * filename_vpath, long *line, long *column,
|
||||
g_strfreev (pos_tokens);
|
||||
}
|
||||
|
||||
g_free (filename);
|
||||
fclose (f);
|
||||
}
|
||||
|
||||
@ -1195,7 +1193,6 @@ save_file_position (const vfs_path_t * filename_vpath, long line, long column, o
|
||||
size_t i;
|
||||
const size_t len = vfs_path_len (filename_vpath);
|
||||
gboolean src_error = FALSE;
|
||||
char *filename;
|
||||
|
||||
if (filepos_max_saved_entries == 0)
|
||||
filepos_max_saved_entries = mc_config_get_int (mc_main_config, CONFIG_APP_SECTION,
|
||||
@ -1220,11 +1217,12 @@ save_file_position (const vfs_path_t * filename_vpath, long line, long column, o
|
||||
goto open_source_error;
|
||||
}
|
||||
|
||||
filename = vfs_path_to_str (filename_vpath);
|
||||
/* put the new record */
|
||||
if (line != 1 || column != 0 || bookmarks != NULL)
|
||||
{
|
||||
if (fprintf (f, "%s %ld;%ld;%" PRIuMAX, filename, line, column, (uintmax_t) offset) < 0)
|
||||
if (fprintf
|
||||
(f, "%s %ld;%ld;%" PRIuMAX, vfs_path_as_str (filename_vpath), line, column,
|
||||
(uintmax_t) offset) < 0)
|
||||
goto write_position_error;
|
||||
if (bookmarks != NULL)
|
||||
for (i = 0; i < bookmarks->len && i < MAX_SAVED_BOOKMARKS; i++)
|
||||
@ -1238,7 +1236,7 @@ save_file_position (const vfs_path_t * filename_vpath, long line, long column, o
|
||||
i = 1;
|
||||
while (fgets (buf, sizeof (buf), tmp_f) != NULL)
|
||||
{
|
||||
if (buf[len] == ' ' && strncmp (buf, filename, len) == 0
|
||||
if (buf[len] == ' ' && strncmp (buf, vfs_path_as_str (filename_vpath), len) == 0
|
||||
&& strchr (&buf[len + 1], ' ') == NULL)
|
||||
continue;
|
||||
|
||||
@ -1248,7 +1246,6 @@ save_file_position (const vfs_path_t * filename_vpath, long line, long column, o
|
||||
}
|
||||
|
||||
write_position_error:
|
||||
g_free (filename);
|
||||
fclose (tmp_f);
|
||||
open_source_error:
|
||||
g_free (tmp_fn);
|
||||
|
@ -29,9 +29,9 @@
|
||||
/* Pathname canonicalization */
|
||||
typedef enum
|
||||
{
|
||||
CANON_PATH_JOINSLASHES = 1L << 0, /* Multiple `/'s are collapsed to a single `/'. */
|
||||
CANON_PATH_REMSLASHDOTS = 1L << 1, /* Leading `./'s, `/'s and trailing `/.'s are removed. */
|
||||
CANON_PATH_REMDOUBLEDOTS = 1L << 3, /* Non-leading `../'s and trailing `..'s are handled by removing */
|
||||
CANON_PATH_JOINSLASHES = 1L << 0, /* Multiple '/'s are collapsed to a single '/'. */
|
||||
CANON_PATH_REMSLASHDOTS = 1L << 1, /* Leading './'s, '/'s and trailing '/.'s are removed. */
|
||||
CANON_PATH_REMDOUBLEDOTS = 1L << 3, /* Non-leading '../'s and trailing '..'s are handled by removing */
|
||||
CANON_PATH_GUARDUNC = 1L << 4, /* Detect and preserve UNC paths: //server/... */
|
||||
CANON_PATH_ALL = CANON_PATH_JOINSLASHES
|
||||
| CANON_PATH_REMSLASHDOTS | CANON_PATH_REMDOUBLEDOTS | CANON_PATH_GUARDUNC
|
||||
@ -168,7 +168,7 @@ void canonicalize_pathname (char *);
|
||||
char *mc_realpath (const char *path, char *resolved_path);
|
||||
#endif
|
||||
|
||||
/* Looks for ``magic'' bytes at the start of the VFS file to guess the
|
||||
/* Looks for "magic" bytes at the start of the VFS file to guess the
|
||||
* compression type. Side effect: modifies the file position. */
|
||||
enum compression_type get_compression_type (int fd, const char *);
|
||||
const char *decompress_extension (int type);
|
||||
|
@ -612,10 +612,10 @@ close_error_pipe (int error, const char *text)
|
||||
/**
|
||||
* Canonicalize path, and return a new path. Do everything in place.
|
||||
* The new path differs from path in:
|
||||
* Multiple `/'s are collapsed to a single `/'.
|
||||
* Leading `./'s and trailing `/.'s are removed.
|
||||
* Trailing `/'s are removed.
|
||||
* Non-leading `../'s and trailing `..'s are handled by removing
|
||||
* Multiple '/'s are collapsed to a single '/'.
|
||||
* Leading './'s and trailing '/.'s are removed.
|
||||
* Trailing '/'s are removed.
|
||||
* Non-leading '../'s and trailing '..'s are handled by removing
|
||||
* portions of the path.
|
||||
* Well formed UNC paths are modified only in the local part.
|
||||
*/
|
||||
|
@ -1,11 +1,12 @@
|
||||
/*
|
||||
Directory cache support
|
||||
|
||||
Copyright (C) 1998, 2011
|
||||
Copyright (C) 1998, 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
Pavel Machek <pavel@ucw.cz>, 1998
|
||||
Slava Zanko <slavazanko@gmail.com>, 2013
|
||||
|
||||
This file is part of the Midnight Commander.
|
||||
|
||||
@ -1260,7 +1261,7 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode)
|
||||
vfs_path_t *tmp_vpath;
|
||||
|
||||
tmp_handle = vfs_mkstemps (&tmp_vpath, path_element->class->name, name);
|
||||
ino->localname = vfs_path_to_str (tmp_vpath);
|
||||
ino->localname = g_strdup (vfs_path_as_str (tmp_vpath));
|
||||
vfs_path_free (tmp_vpath);
|
||||
if (tmp_handle == -1)
|
||||
{
|
||||
@ -1353,7 +1354,7 @@ vfs_s_retrieve_file (struct vfs_class *me, struct vfs_s_inode *ino)
|
||||
fh.handle = -1;
|
||||
|
||||
handle = vfs_mkstemps (&tmp_vpath, me->name, ino->ent->name);
|
||||
ino->localname = vfs_path_to_str (tmp_vpath);
|
||||
ino->localname = g_strdup (vfs_path_as_str (tmp_vpath));
|
||||
vfs_path_free (tmp_vpath);
|
||||
if (handle == -1)
|
||||
{
|
||||
|
@ -1,11 +1,11 @@
|
||||
/*
|
||||
Virtual File System: interface functions
|
||||
|
||||
Copyright (C) 2011
|
||||
Copyright (C) 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
Slava Zanko <slavazanko@gmail.com>, 2011
|
||||
Slava Zanko <slavazanko@gmail.com>, 2011, 2013
|
||||
|
||||
This file is part of the Midnight Commander.
|
||||
|
||||
@ -878,16 +878,12 @@ mc_tmpdir (void)
|
||||
g_free (fallback_prefix);
|
||||
if (test_fd != -1)
|
||||
{
|
||||
char *test_fn;
|
||||
|
||||
test_fn = vfs_path_to_str (test_vpath);
|
||||
close (test_fd);
|
||||
test_fd = open (test_fn, O_RDONLY);
|
||||
g_free (test_fn);
|
||||
test_fd = open (vfs_path_as_str (test_vpath), O_RDONLY);
|
||||
if (test_fd != -1)
|
||||
{
|
||||
close (test_fd);
|
||||
unlink (test_fn);
|
||||
unlink (vfs_path_as_str (test_vpath));
|
||||
fallback_ok = TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Routines for parsing output from the `ls' command.
|
||||
Routines for parsing output from the 'ls' command.
|
||||
|
||||
Copyright (C) 1988, 1992, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
2005, 2006, 2007, 2011
|
||||
|
112
lib/vfs/path.c
112
lib/vfs/path.c
@ -1,11 +1,12 @@
|
||||
/*
|
||||
Virtual File System path handlers
|
||||
|
||||
Copyright (C) 2011
|
||||
Copyright (C) 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
Slava Zanko <slavazanko@gmail.com>, 2011
|
||||
Slava Zanko <slavazanko@gmail.com>, 2011, 2013
|
||||
Andrew Borodin <aborodin@vmail.ru>, 2013
|
||||
|
||||
This file is part of the Midnight Commander.
|
||||
|
||||
@ -181,39 +182,34 @@ vfs_canon (const char *path)
|
||||
#ifdef HAVE_CHARSET
|
||||
/** get encoding after last #enc: or NULL, if part does not contain #enc:
|
||||
*
|
||||
* @param path string
|
||||
* @param path null-terminated string
|
||||
* @param len the maximum length of path, where #enc: should be searched
|
||||
*
|
||||
* @return newly allocated string.
|
||||
*/
|
||||
|
||||
static char *
|
||||
vfs_get_encoding (const char *path)
|
||||
vfs_get_encoding (const char *path, ssize_t len)
|
||||
{
|
||||
char result[16];
|
||||
char *work;
|
||||
char *semi;
|
||||
char *slash;
|
||||
work = g_strdup (path);
|
||||
|
||||
/* try found #enc: */
|
||||
semi = g_strrstr (work, VFS_ENCODING_PREFIX);
|
||||
semi = g_strrstr_len (path, len, VFS_ENCODING_PREFIX);
|
||||
if (semi == NULL)
|
||||
return NULL;
|
||||
|
||||
if (semi != NULL && (semi == work || *(semi - 1) == PATH_SEP))
|
||||
if (semi == path || *(semi - 1) == PATH_SEP)
|
||||
{
|
||||
char *slash;
|
||||
|
||||
semi += strlen (VFS_ENCODING_PREFIX); /* skip "#enc:" */
|
||||
slash = strchr (semi, PATH_SEP);
|
||||
if (slash != NULL)
|
||||
slash[0] = '\0';
|
||||
return g_strndup (semi, slash - semi);
|
||||
return g_strdup (semi);
|
||||
}
|
||||
|
||||
g_strlcpy (result, semi, sizeof (result));
|
||||
g_free (work);
|
||||
return g_strdup (result);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_free (work);
|
||||
return NULL;
|
||||
}
|
||||
return vfs_get_encoding (path, semi - path);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -388,7 +384,7 @@ vfs_path_from_str_deprecated_parser (char *path, vfs_path_flag_t flags)
|
||||
element->path = vfs_translate_path_n (local);
|
||||
|
||||
#ifdef HAVE_CHARSET
|
||||
element->encoding = vfs_get_encoding (local);
|
||||
element->encoding = vfs_get_encoding (local, -1);
|
||||
element->dir.converter =
|
||||
(element->encoding != NULL) ? str_crt_conv_from (element->encoding) : INVALID_CONV;
|
||||
#endif
|
||||
@ -413,7 +409,7 @@ vfs_path_from_str_deprecated_parser (char *path, vfs_path_flag_t flags)
|
||||
element->path = vfs_translate_path_n (path);
|
||||
|
||||
#ifdef HAVE_CHARSET
|
||||
element->encoding = vfs_get_encoding (path);
|
||||
element->encoding = vfs_get_encoding (path, -1);
|
||||
element->dir.converter =
|
||||
(element->encoding != NULL) ? str_crt_conv_from (element->encoding) : INVALID_CONV;
|
||||
#endif
|
||||
@ -476,7 +472,7 @@ vfs_path_from_str_uri_parser (char *path, vfs_path_flag_t flags)
|
||||
{
|
||||
element->path = vfs_translate_path_n (slash_pointer + 1);
|
||||
#ifdef HAVE_CHARSET
|
||||
element->encoding = vfs_get_encoding (slash_pointer);
|
||||
element->encoding = vfs_get_encoding (slash_pointer, -1);
|
||||
#endif
|
||||
*slash_pointer = '\0';
|
||||
}
|
||||
@ -486,7 +482,7 @@ vfs_path_from_str_uri_parser (char *path, vfs_path_flag_t flags)
|
||||
{
|
||||
element->path = vfs_translate_path_n (url_delimiter);
|
||||
#ifdef HAVE_CHARSET
|
||||
element->encoding = vfs_get_encoding (url_delimiter);
|
||||
element->encoding = vfs_get_encoding (url_delimiter, -1);
|
||||
#endif
|
||||
}
|
||||
#ifdef HAVE_CHARSET
|
||||
@ -508,7 +504,7 @@ vfs_path_from_str_uri_parser (char *path, vfs_path_flag_t flags)
|
||||
element->class = g_ptr_array_index (vfs__classes_list, 0);
|
||||
element->path = vfs_translate_path_n (path);
|
||||
#ifdef HAVE_CHARSET
|
||||
element->encoding = vfs_get_encoding (path);
|
||||
element->encoding = vfs_get_encoding (path, -1);
|
||||
element->dir.converter =
|
||||
(element->encoding != NULL) ? str_crt_conv_from (element->encoding) : INVALID_CONV;
|
||||
#endif
|
||||
@ -591,8 +587,6 @@ vfs_path_strip_home (const char *dir)
|
||||
return g_strdup (dir);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/*** public functions ****************************************************************************/
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
@ -713,21 +707,6 @@ vfs_path_to_str_elements_count (const vfs_path_t * vpath, int elements_count)
|
||||
return vfs_path_to_str_flags (vpath, elements_count, VPF_NONE);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/**
|
||||
* Convert vfs_path_t to string representation.
|
||||
*
|
||||
* @param vpath pointer to vfs_path_t object
|
||||
*
|
||||
* @return pointer to newly created string.
|
||||
*/
|
||||
|
||||
char *
|
||||
vfs_path_to_str (const vfs_path_t * vpath)
|
||||
{
|
||||
return vfs_path_to_str_elements_count (vpath, vfs_path_elements_count (vpath));
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/**
|
||||
* Split path string to path elements with flags for change parce process.
|
||||
@ -760,6 +739,7 @@ vfs_path_from_str_flags (const char *path_str, vfs_path_flag_t flags)
|
||||
else
|
||||
vpath = vfs_path_from_str_uri_parser (path, flags);
|
||||
|
||||
vpath->str = vfs_path_to_str_flags (vpath, 0, VPF_NONE);
|
||||
g_free (path);
|
||||
|
||||
return vpath;
|
||||
@ -824,6 +804,8 @@ void
|
||||
vfs_path_add_element (const vfs_path_t * vpath, const vfs_path_element_t * path_element)
|
||||
{
|
||||
g_array_append_val (vpath->path, path_element);
|
||||
g_free (vpath->str);
|
||||
((vfs_path_t *) vpath)->str = vfs_path_to_str_flags (vpath, 0, VPF_NONE);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
@ -944,6 +926,7 @@ vfs_path_clone (const vfs_path_t * vpath)
|
||||
path_element = vfs_path_element_clone (vfs_path_get_by_index (vpath, vpath_element_index));
|
||||
g_array_append_val (new_vpath->path, path_element);
|
||||
}
|
||||
new_vpath->str = g_strdup (vpath->str);
|
||||
|
||||
return new_vpath;
|
||||
}
|
||||
@ -974,6 +957,7 @@ vfs_path_free (vfs_path_t * vpath)
|
||||
}
|
||||
|
||||
g_array_free (vpath->path, TRUE);
|
||||
g_free (vpath->str);
|
||||
g_free (vpath);
|
||||
}
|
||||
|
||||
@ -1000,6 +984,8 @@ vfs_path_remove_element_by_index (vfs_path_t * vpath, int element_index)
|
||||
element = (vfs_path_element_t *) vfs_path_get_by_index (vpath, element_index);
|
||||
vpath->path = g_array_remove_index (vpath->path, element_index);
|
||||
vfs_path_element_free (element);
|
||||
g_free (vpath->str);
|
||||
vpath->str = vfs_path_to_str_flags (vpath, 0, VPF_NONE);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
@ -1185,6 +1171,7 @@ vfs_path_deserialize (const char *data, GError ** error)
|
||||
g_set_error (error, MC_ERROR, -1, "No any path elements found");
|
||||
return NULL;
|
||||
}
|
||||
vpath->str = vfs_path_to_str_flags (vpath, 0, VPF_NONE);
|
||||
|
||||
return vpath;
|
||||
}
|
||||
@ -1232,7 +1219,8 @@ vfs_path_t *
|
||||
vfs_path_append_new (const vfs_path_t * vpath, const char *first_element, ...)
|
||||
{
|
||||
va_list args;
|
||||
char *str_path, *result_str;
|
||||
char *str_path;
|
||||
const char *result_str;
|
||||
vfs_path_t *ret_vpath;
|
||||
|
||||
if (vpath == NULL || first_element == NULL)
|
||||
@ -1242,9 +1230,8 @@ vfs_path_append_new (const vfs_path_t * vpath, const char *first_element, ...)
|
||||
str_path = mc_build_filenamev (first_element, args);
|
||||
va_end (args);
|
||||
|
||||
result_str = vfs_path_to_str (vpath);
|
||||
result_str = vfs_path_as_str (vpath);
|
||||
ret_vpath = vfs_path_build_filename (result_str, str_path, NULL);
|
||||
g_free (result_str);
|
||||
g_free (str_path);
|
||||
|
||||
return ret_vpath;
|
||||
@ -1291,6 +1278,8 @@ vfs_path_append_vpath_new (const vfs_path_t * first_vpath, ...)
|
||||
while (current_vpath != NULL);
|
||||
va_end (args);
|
||||
|
||||
ret_vpath->str = vfs_path_to_str_flags (ret_vpath, 0, VPF_NONE);
|
||||
|
||||
return ret_vpath;
|
||||
}
|
||||
|
||||
@ -1535,21 +1524,17 @@ vfs_path_element_build_pretty_path_str (const vfs_path_element_t * element)
|
||||
gboolean
|
||||
vfs_path_equal (const vfs_path_t * vpath1, const vfs_path_t * vpath2)
|
||||
{
|
||||
char *path1;
|
||||
char *path2;
|
||||
const char *path1, *path2;
|
||||
gboolean ret_val;
|
||||
|
||||
if (vpath1 == NULL || vpath2 == NULL)
|
||||
return FALSE;
|
||||
|
||||
path1 = vfs_path_to_str (vpath1);
|
||||
path2 = vfs_path_to_str (vpath2);
|
||||
path1 = vfs_path_as_str (vpath1);
|
||||
path2 = vfs_path_as_str (vpath2);
|
||||
|
||||
ret_val = strcmp (path1, path2) == 0;
|
||||
|
||||
g_free (path1);
|
||||
g_free (path2);
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
@ -1567,21 +1552,17 @@ vfs_path_equal (const vfs_path_t * vpath1, const vfs_path_t * vpath2)
|
||||
gboolean
|
||||
vfs_path_equal_len (const vfs_path_t * vpath1, const vfs_path_t * vpath2, size_t len)
|
||||
{
|
||||
char *path1;
|
||||
char *path2;
|
||||
const char *path1, *path2;
|
||||
gboolean ret_val;
|
||||
|
||||
if (vpath1 == NULL || vpath2 == NULL)
|
||||
return FALSE;
|
||||
|
||||
path1 = vfs_path_to_str (vpath1);
|
||||
path2 = vfs_path_to_str (vpath2);
|
||||
path1 = vfs_path_as_str (vpath1);
|
||||
path2 = vfs_path_as_str (vpath2);
|
||||
|
||||
ret_val = strncmp (path1, path2, len) == 0;
|
||||
|
||||
g_free (path1);
|
||||
g_free (path2);
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
@ -1597,16 +1578,10 @@ vfs_path_equal_len (const vfs_path_t * vpath1, const vfs_path_t * vpath2, size_t
|
||||
size_t
|
||||
vfs_path_len (const vfs_path_t * vpath)
|
||||
{
|
||||
char *path;
|
||||
size_t ret_val;
|
||||
|
||||
if (vpath == NULL)
|
||||
return 0;
|
||||
|
||||
path = vfs_path_to_str (vpath);
|
||||
ret_val = strlen (path);
|
||||
g_free (path);
|
||||
return ret_val;
|
||||
return strlen (vpath->str);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
@ -1622,14 +1597,13 @@ vfs_path_t *
|
||||
vfs_path_to_absolute (const vfs_path_t * vpath)
|
||||
{
|
||||
vfs_path_t *absolute_vpath;
|
||||
char *path_str;
|
||||
const char *path_str;
|
||||
|
||||
if (!vpath->relative)
|
||||
return vfs_path_clone (vpath);
|
||||
|
||||
path_str = vfs_path_to_str (vpath);
|
||||
path_str = vfs_path_as_str (vpath);
|
||||
absolute_vpath = vfs_path_from_str (path_str);
|
||||
g_free (path_str);
|
||||
return absolute_vpath;
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,7 @@ typedef struct
|
||||
{
|
||||
gboolean relative;
|
||||
GArray *path;
|
||||
char *str;
|
||||
} vfs_path_t;
|
||||
|
||||
typedef struct
|
||||
@ -62,7 +63,6 @@ void vfs_path_remove_element_by_index (vfs_path_t * vpath, int element_index);
|
||||
void vfs_path_free (vfs_path_t * path);
|
||||
int vfs_path_elements_count (const vfs_path_t * path);
|
||||
|
||||
char *vfs_path_to_str (const vfs_path_t * path);
|
||||
char *vfs_path_to_str_elements_count (const vfs_path_t * path, int elements_count);
|
||||
char *vfs_path_to_str_flags (const vfs_path_t * vpath, int elements_count, vfs_path_flag_t flags);
|
||||
vfs_path_t *vfs_path_from_str (const char *path_str);
|
||||
@ -128,4 +128,23 @@ vfs_path_get_last_path_vfs (const vfs_path_t * vpath)
|
||||
return (element != NULL) ? element->class : NULL;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/**
|
||||
* Convert vfs_path_t to string representation.
|
||||
*
|
||||
* @param vpath pointer to vfs_path_t object
|
||||
*
|
||||
* @return pointer to newly created string.
|
||||
*/
|
||||
|
||||
static inline char *
|
||||
vfs_path_as_str (const vfs_path_t * vpath)
|
||||
{
|
||||
if (vpath == NULL)
|
||||
return NULL;
|
||||
return vpath->str;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
#endif
|
||||
|
@ -2,12 +2,13 @@
|
||||
Virtual File System switch code
|
||||
|
||||
Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
||||
2007, 2011
|
||||
2007, 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Written by: 1995 Miguel de Icaza
|
||||
Jakub Jelinek, 1995
|
||||
Pavel Machek, 1998
|
||||
Slava Zanko <slavazanko@gmail.com>, 2013
|
||||
|
||||
This file is part of the Midnight Commander.
|
||||
|
||||
@ -370,7 +371,7 @@ vfs_translate_path_n (const char *path)
|
||||
char *
|
||||
vfs_get_current_dir (void)
|
||||
{
|
||||
return vfs_path_to_str (current_path);
|
||||
return g_strdup (current_path->str);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
@ -579,8 +580,11 @@ vfs_setup_cwd (void)
|
||||
char *
|
||||
_vfs_get_cwd (void)
|
||||
{
|
||||
const vfs_path_t *current_dir_vpath;
|
||||
|
||||
vfs_setup_cwd ();
|
||||
return vfs_path_to_str (vfs_get_raw_current_dir ());
|
||||
current_dir_vpath = vfs_get_raw_current_dir ();
|
||||
return g_strdup (vfs_path_as_str (current_dir_vpath));
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -2,7 +2,7 @@
|
||||
Widgets for the Midnight Commander
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003,
|
||||
2004, 2005, 2006, 2007, 2009, 2010, 2011
|
||||
2004, 2005, 2006, 2007, 2009, 2010, 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Authors:
|
||||
@ -11,7 +11,7 @@
|
||||
Jakub Jelinek, 1995
|
||||
Andrej Borsenkow, 1996
|
||||
Norbert Warmuth, 1997
|
||||
Andrew Borodin <aborodin@vmail.ru>, 2009, 2010
|
||||
Andrew Borodin <aborodin@vmail.ru>, 2009, 2010, 2013
|
||||
|
||||
This file is part of the Midnight Commander.
|
||||
|
||||
@ -240,6 +240,7 @@ button_set_text (WButton * b, const char *text)
|
||||
|
||||
release_hotkey (b->text);
|
||||
b->text = parse_hotkey (text);
|
||||
b->hotpos = (b->text.hotkey != NULL) ? str_term_width1 (b->text.start) : -1;
|
||||
w->cols = button_get_len (b);
|
||||
widget_redraw (w);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
Dialog box features module for the Midnight Commander
|
||||
|
||||
Copyright (C) 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
2005, 2007, 2009, 2010, 2011
|
||||
2005, 2007, 2009, 2010, 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the Midnight Commander.
|
||||
@ -587,17 +587,6 @@ dlg_find_widget_by_id (gconstpointer a, gconstpointer b)
|
||||
/*** public functions ****************************************************************************/
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
/** draw box in window */
|
||||
void
|
||||
draw_box (const WDialog * h, int y, int x, int ys, int xs, gboolean single)
|
||||
{
|
||||
const Widget *wh = WIDGET (h);
|
||||
|
||||
tty_draw_box (wh->y + y, wh->x + x, ys, xs, single);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
/** Clean the dialog area, draw the frame and the title */
|
||||
void
|
||||
dlg_default_repaint (WDialog * h)
|
||||
@ -613,7 +602,7 @@ dlg_default_repaint (WDialog * h)
|
||||
|
||||
tty_setcolor (h->color[DLG_COLOR_NORMAL]);
|
||||
dlg_erase (h);
|
||||
draw_box (h, space, space, wh->lines - 2 * space, wh->cols - 2 * space, FALSE);
|
||||
tty_draw_box (wh->y + space, wh->x + space, wh->lines - 2 * space, wh->cols - 2 * space, FALSE);
|
||||
|
||||
if (h->title != NULL)
|
||||
{
|
||||
|
@ -124,9 +124,6 @@ extern const global_keymap_t *dialog_map;
|
||||
|
||||
/*** declarations of public functions ************************************************************/
|
||||
|
||||
/* draw box in window */
|
||||
void draw_box (const WDialog * h, int y, int x, int ys, int xs, gboolean single);
|
||||
|
||||
/* Creates a dialog head */
|
||||
WDialog *create_dlg (gboolean modal, int y1, int x1, int lines, int cols,
|
||||
const int *colors, widget_cb_fn callback, mouse_h mouse_handler,
|
||||
|
@ -2,7 +2,7 @@
|
||||
Widgets for the Midnight Commander
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003,
|
||||
2004, 2005, 2006, 2007, 2009, 2010, 2011
|
||||
2004, 2005, 2006, 2007, 2009, 2010, 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Authors:
|
||||
@ -11,7 +11,7 @@
|
||||
Jakub Jelinek, 1995
|
||||
Andrej Borsenkow, 1996
|
||||
Norbert Warmuth, 1997
|
||||
Andrew Borodin <aborodin@vmail.ru>, 2009, 2010
|
||||
Andrew Borodin <aborodin@vmail.ru>, 2009, 2010, 2013
|
||||
|
||||
This file is part of the Midnight Commander.
|
||||
|
||||
@ -67,16 +67,18 @@ groupbox_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
|
||||
|
||||
case MSG_DRAW:
|
||||
{
|
||||
Widget *wo = WIDGET (w->owner);
|
||||
gboolean disabled;
|
||||
|
||||
gboolean disabled = (w->options & W_DISABLED) != 0;
|
||||
disabled = (w->options & W_DISABLED) != 0;
|
||||
tty_setcolor (disabled ? DISABLED_COLOR : COLOR_NORMAL);
|
||||
draw_box (w->owner, w->y - wo->y, w->x - wo->x, w->lines, w->cols, TRUE);
|
||||
tty_draw_box (w->y, w->x, w->lines, w->cols, TRUE);
|
||||
|
||||
if (g->title != NULL)
|
||||
{
|
||||
Widget *wo = WIDGET (w->owner);
|
||||
|
||||
tty_setcolor (disabled ? DISABLED_COLOR : COLOR_TITLE);
|
||||
widget_move (w->owner, w->y - wo->y, w->x - wo->x + 1);
|
||||
widget_move (wo, w->y - wo->y, w->x - wo->x + 1);
|
||||
tty_print_string (g->title);
|
||||
}
|
||||
return MSG_HANDLED;
|
||||
|
@ -290,7 +290,7 @@ filename_completion_function (const char *text, int state, input_complete_t flag
|
||||
{
|
||||
g_string_append (temp, users_dirname);
|
||||
|
||||
/* We need a `/' at the end. */
|
||||
/* We need a '/' at the end. */
|
||||
if (temp->str[temp->len - 1] != PATH_SEP)
|
||||
g_string_append_c (temp, PATH_SEP);
|
||||
}
|
||||
@ -851,7 +851,7 @@ try_complete_commands_prepare (try_complete_automation_state_t * state, char *te
|
||||
|
||||
if (ti != text)
|
||||
{
|
||||
/* Handle the two character tokens `>&', `<&', and `>|'.
|
||||
/* Handle the two character tokens '>&', '<&', and '>|'.
|
||||
We are not in a command position after one of these. */
|
||||
this_char = ti[0];
|
||||
prev_char = str_get_prev_char (ti)[0];
|
||||
@ -1339,7 +1339,7 @@ try_complete (char *text, int *lc_start, int *lc_end, input_complete_t flags)
|
||||
*lc_start += state.r - state.word;
|
||||
}
|
||||
|
||||
/* Starts with `~' and there is no slash in the word, then
|
||||
/* Starts with '~' and there is no slash in the word, then
|
||||
try completing this word as a username. */
|
||||
if (!matches && *state.word == '~' && (state.flags & INPUT_COMPLETE_USERNAMES)
|
||||
&& !strchr (state.word, PATH_SEP))
|
||||
|
@ -188,7 +188,7 @@ menubar_draw_drop (WMenuBar * menubar)
|
||||
column = w->cols - menu->max_entry_len - 5;
|
||||
|
||||
tty_setcolor (MENU_ENTRY_COLOR);
|
||||
draw_box (w->owner, w->y + 1, w->x + column, count + 2, menu->max_entry_len + 5, FALSE);
|
||||
tty_draw_box (w->y + 1, w->x + column, count + 2, menu->max_entry_len + 5, FALSE);
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
menubar_paint_idx (menubar, i,
|
||||
|
@ -42,7 +42,7 @@ ac_fsusage_space=no
|
||||
# Perform only the link test since it seems there are no variants of the
|
||||
# statvfs function. This check is more than just AC_CHECK_FUNCS([statvfs])
|
||||
# because that got a false positive on SCO OSR5. Adding the declaration
|
||||
# of a `struct statvfs' causes this test to fail (as it should) on such
|
||||
# of a 'struct statvfs' causes this test to fail (as it should) on such
|
||||
# systems. That system is reported to work fine with STAT_STATFS4 which
|
||||
# is what it gets when this test fails.
|
||||
if test $ac_fsusage_space = no; then
|
||||
|
@ -70,7 +70,7 @@ AC_FUNC_GETMNTENT
|
||||
# with other getmntent implementations.
|
||||
|
||||
# NOTE: Normally, I wouldn't use a check for system type as I've done for
|
||||
# `CRAY' below since that goes against the whole autoconf philosophy. But
|
||||
# 'CRAY' below since that goes against the whole autoconf philosophy. But
|
||||
# I think there is too great a chance that some non-Cray system has a
|
||||
# function named listmntent to risk the false positive.
|
||||
|
||||
@ -110,7 +110,7 @@ if test -z "$ac_list_mounted_fs"; then
|
||||
AC_DEFINE([MOUNTED_VMOUNT], [1],
|
||||
[Define if there is a function named mntctl that can be used to read
|
||||
the list of mounted file systems, and there is a system header file
|
||||
that declares `struct vmount.' (AIX)])
|
||||
that declares 'struct vmount.' (AIX)])
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -9,7 +9,7 @@ dnl @copyright Free Software Foundation, Inc.
|
||||
|
||||
AC_DEFUN([MC_VERSION],[
|
||||
if test ! -f ${srcdir}/version.h; then
|
||||
${srcdir}/maint/version.sh ${srcdir}
|
||||
${srcdir}/maint/utils/version.sh ${srcdir}
|
||||
fi
|
||||
if test -f ${srcdir}/version.h; then
|
||||
VERSION=$(grep '^#define MC_CURRENT_VERSION' ${srcdir}/version.h | sed 's/.*"\(.*\)"$/\1/')
|
||||
|
@ -35,7 +35,7 @@ AC_DEFUN([MC_ENABLE_VFS_NET],
|
||||
if test x"$have_socket" = xyes; then
|
||||
AC_CHECK_TYPE([nlink_t], ,
|
||||
[AC_DEFINE_UNQUOTED([nlink_t], [unsigned int],
|
||||
[Define to `unsigned int' if <sys/types.h> does not define.])])
|
||||
[Define to 'unsigned int' if <sys/types.h> does not define.])])
|
||||
AC_CHECK_TYPES([socklen_t],,,
|
||||
[
|
||||
#include <sys/types.h>
|
||||
|
@ -1,53 +0,0 @@
|
||||
This document describes step by step the release procedure of GNU
|
||||
Midnight Commander.
|
||||
|
||||
${dotted_version} shall be replaced by something like 4.6
|
||||
${underscore_version} shall be replaced by something like 4_6
|
||||
|
||||
=== day 0 (translator's prerelease) ===
|
||||
|
||||
* Check out a fresh copy from the CVS repository.
|
||||
|
||||
* Update the translation files NOT to contain line number information.
|
||||
Commit them.
|
||||
* Tag the CVS tree as "MC_${underscore_version}_translators".
|
||||
* Update the translation files to contain line number information.
|
||||
DON'T commit them.
|
||||
* Run "make dist".
|
||||
* Upload the distribution tarballs and the individual translation files
|
||||
somewhere where the translators can download it.
|
||||
* Announce the availibility of the translator's prerelease on mc-devel.
|
||||
Inform the translators of the prerelease.
|
||||
Inform the developers of a fourteen-day "feature-freeze".
|
||||
|
||||
=== day 11 (reminder) ===
|
||||
|
||||
* announce a reminder on mc-devel that the release will occur in three
|
||||
days.
|
||||
|
||||
=== day 14 (official release) ===
|
||||
|
||||
* Review the English version of the manual and fix it if necessary.
|
||||
Update the date and the version number in the .TH macro of the English
|
||||
manual pages.
|
||||
* Update the NEWS file to contain all user-visible changes.
|
||||
* Set the version number in configure.ac to "${dotted_version}".
|
||||
Commit it.
|
||||
* Update the translation files NOT to contain line number information.
|
||||
Commit them.
|
||||
* Run the test suites maint/mctest and maint/mc-test and make sure
|
||||
all warnings are ok.
|
||||
* Tag the CVS tree as "MC_${underscore_version}_release".
|
||||
* Create a CVS branch "MC_${underscore_version}".
|
||||
* Run "make dist".
|
||||
* Upload the resulting tarballs to the Savannah repository.
|
||||
* Announce the new release on the mc-devel and mc mailing lists.
|
||||
* Update the homepage.
|
||||
|
||||
=== post-release actions ===
|
||||
|
||||
* Create binary packages from the uploaded tarballs as necessary.
|
||||
|
||||
=== back to work ===
|
||||
|
||||
* Discuss milestones for the next release on the mc-devel list.
|
58
maint/docs/RELEASE_PROCEDURE
Обычный файл
58
maint/docs/RELEASE_PROCEDURE
Обычный файл
@ -0,0 +1,58 @@
|
||||
# ---------------------------------------------------------------------------------------
|
||||
|
||||
Scenario #1
|
||||
As developer
|
||||
I Want To prepare release files for review by developers
|
||||
|
||||
Given have latest version from 'git tag' output (saved to ${last_version})
|
||||
and latest version is increased (saved to ${next_version})
|
||||
|
||||
When I want To: prepare to release
|
||||
|
||||
Then I Should: sync PO translations from Transifex.net
|
||||
and sync mc.hint translations from Transifex.net
|
||||
and create new NEWS wiki page for ${next_version} with empty template
|
||||
and add content of NEWS-${last_version} wiki page to the doc/NEWS file in git repo
|
||||
and create new tag '${next_version}' in git
|
||||
and add new version '${last_version}' in Trac
|
||||
and add new milestone '${next_version}' in Trac
|
||||
and create tar.(bz2|xz) package files
|
||||
and create checksums for archives:
|
||||
and upload source packages and checksums to the special upload area
|
||||
|
||||
# ---------------------------------------------------------------------------------------
|
||||
|
||||
Scenario #2
|
||||
As developer
|
||||
I Want To review files prepared for release
|
||||
|
||||
Given have prepared files for review
|
||||
|
||||
When I Want To: release next version
|
||||
|
||||
Then I Should: download archives from special upload area
|
||||
and download checksums for archives from special upload area
|
||||
and verify checksums and archives
|
||||
and unpack arhives
|
||||
and configure with default parameters
|
||||
and run 'make all install DESTDIR=/tmp/mc-release'
|
||||
and if everything is okay, keep vote in release ticket
|
||||
|
||||
# ---------------------------------------------------------------------------------------
|
||||
|
||||
Scenario #3
|
||||
As developer
|
||||
I Want To complete the release procedure
|
||||
|
||||
Given have votes from developers
|
||||
|
||||
When I Want To: complete the release
|
||||
|
||||
Then I Should: upload source packages and checksums to http://www.midnight-commander.org/downloads
|
||||
and update Wiki start page with ${next_version} release number
|
||||
and write an announcement in mc-dev and mc-users mailists: list user visible changes (bugs and features)
|
||||
and close milestone with '${last_version}' version
|
||||
and create new ticket (type=task, component=adm) for the next release
|
||||
and close ticket for release.
|
||||
|
||||
# ---------------------------------------------------------------------------------------
|
@ -1,37 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Run this script in the top-level source directory to check the
|
||||
# documentation for compatibility with groff and nroff.
|
||||
|
||||
set -e
|
||||
|
||||
one_test() {
|
||||
"$@" >/dev/null 2>doctest.err
|
||||
if test -s doctest.err; then
|
||||
echo "ERROR messages follow:" 2>&1
|
||||
cat doctest.err 2>&1
|
||||
echo "ERROR while running following command:" 2>&1
|
||||
echo "$@" 2>&1
|
||||
echo "ERROR messages are preserved in doctest.err"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
test -r doc/man/mc.1.in || { echo "ERROR: cannot read doc/mc.1.in" 2>&1; exit 1; }
|
||||
|
||||
# Test the documentation for possible errors.
|
||||
for i in `find doc -name '*.[1-9].in'`; do
|
||||
echo "test $i"
|
||||
cat $i |preconv -e UTF8| groff -wall -mandoc -Tutf8 | grep "warning:"
|
||||
done
|
||||
|
||||
for i in `find doc -name '*.[1-9].in'`; do
|
||||
echo "test $i"
|
||||
cat $i |preconv -e UTF8| nroff -Tutf8 -mandoc | grep "warning:"
|
||||
done
|
||||
|
||||
# Check the English manuals to be in ASCII.
|
||||
one_test find doc -maxdepth 1 -name '*.[1-9].in' -exec groff -wall -Tascii {} \;
|
||||
|
||||
rm -rf doctest.err
|
||||
exit 0
|
@ -1,48 +0,0 @@
|
||||
This file documents some conventions for sorting system header files in
|
||||
the #include section.
|
||||
|
||||
1. #include <config.h> unconditionally
|
||||
|
||||
2. if there are any headers containing "alloca" in the name, include
|
||||
them here. Some systems need them as the first header.
|
||||
|
||||
3. #include the Standard C Library headers, sorted alphabetically
|
||||
|
||||
(assert, ctype, errno, float, limits, locale, math, setjmp, signal,
|
||||
stdarg, stddef, stdio, stdlib, string, time)
|
||||
|
||||
4. #include the POSIX headers, in the following order
|
||||
|
||||
<sys/types.h> Needed by many other headers.
|
||||
<sys/*.h>
|
||||
<*.h>
|
||||
|
||||
For every POSIX function you use, make sure that the order of the
|
||||
headers is the same as in the according manpage.
|
||||
|
||||
5. #include other external headers
|
||||
|
||||
6. #include "../src/global.h"
|
||||
|
||||
This file contains lots of compatibility stuff that is used
|
||||
throughout the whole mc. All mc header files rely on this file to be
|
||||
included before them.
|
||||
|
||||
7. #include Midnight Commander headers
|
||||
|
||||
Currently, not all headers can be ordered arbitrarily, so try it out.
|
||||
|
||||
|
||||
==== Headers that may be included unconditionally ====
|
||||
|
||||
All ISO C90 headers.
|
||||
|
||||
<sys/types.h>
|
||||
<sys/stat.h>
|
||||
<unistd.h>
|
||||
<fcntl.h>
|
||||
|
||||
==== Headers that need autoconf guards ====
|
||||
|
||||
<termios.h>
|
||||
<sys/ioctl.h>
|
22
maint/ldiff
22
maint/ldiff
@ -1,22 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
# This script makes pretty looking patches provided that the old files
|
||||
# are kept around with the .v0 suffix.
|
||||
|
||||
: ${backup_suffix=${1:-"\.v0"}}
|
||||
backup_files=`find . -path "*$backup_suffix" -type f | sort -u`
|
||||
for oldfile in $backup_files; do
|
||||
newfile=`echo $oldfile | sed 's,^\./,,;s/'$backup_suffix'$//'`
|
||||
oldlabel="$oldprefix$newfile"
|
||||
newlabel="$newprefix$newfile"
|
||||
find "$oldfile" ! -size 0 | grep . >/dev/null || \
|
||||
{ oldfile="/dev/null"; oldlabel="/dev/null"; }
|
||||
find "$newfile" ! -size 0 | grep . >/dev/null || \
|
||||
{ newfile="/dev/null"; newlabel="/dev/null"; }
|
||||
case $newfile in
|
||||
*.c) dflags="-u -p" ;;
|
||||
*.po) dflags='-U 1 -I^#[:,.~]';;
|
||||
*) dflags="-u" ;;
|
||||
esac
|
||||
diff $dflags -L "$oldlabel" -L "$newlabel" "$oldfile" "$newfile"
|
||||
done
|
523
maint/mc-test
523
maint/mc-test
@ -1,523 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Midnight Commander Test Suite
|
||||
#
|
||||
# (c) 2005 Roland Illig <roland.illig@gmx.de>
|
||||
#
|
||||
# The Midnight Commander is free software: you can redistribute it
|
||||
# and/or modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
#
|
||||
# The Midnight Commander is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set -efu
|
||||
|
||||
### initialize environment ###
|
||||
|
||||
LC_CTYPE="C"; export LC_ALL
|
||||
LC_COLLATE="C"; export LC_COLLATE
|
||||
LC_MONETARY="C"; export LC_MONETARY
|
||||
LC_NUMERIC="C"; export LC_NUMERIC
|
||||
LC_TIME="C"; export LC_TIME
|
||||
LC_MESSAGES="C"; export LC_MESSAGES
|
||||
LC_ALL="C"; export LC_ALL
|
||||
|
||||
### set default configuration ###
|
||||
|
||||
mc_nice_value="19"
|
||||
mc_maxlines="10"
|
||||
|
||||
mc_basedir="/tmp/mc-current-build"
|
||||
mc_srcdir="" # default: ${mc_basedir}/src
|
||||
mc_builddir="" # default: ${mc_basedir}/build
|
||||
mc_prefixdir="" # default: ${mc_basedir}/installed
|
||||
mc_logdir="" # default: ${mc_basedir}/logs
|
||||
|
||||
mc_cvs_rsh="ssh"
|
||||
mc_cvs_repository=":pserver:anonymous:@cvs.savannah.gnu.org:/sources/mc"
|
||||
mc_cvs_module="mc"
|
||||
mc_cvs_tag="HEAD"
|
||||
|
||||
mc_configure_args_pre="--enable-maintainer-mode"
|
||||
mc_configure_args_post=""
|
||||
|
||||
mc_make="make"
|
||||
mc_make_flags=""
|
||||
|
||||
mc_cpp="" # default: ${mc_cc} -E
|
||||
mc_cppflags=""
|
||||
|
||||
mc_cc="cc"
|
||||
mc_cflags=""
|
||||
|
||||
mc_ldflags=""
|
||||
|
||||
mc_tests="plain charset no_charset vfs no_vfs samba "\
|
||||
"no_samba ext2undel no_ext2undel slang ncurses maintainer "\
|
||||
"no_maintainer i18n no_i18n no_features all_features"
|
||||
|
||||
do_clean_basedir=no
|
||||
do_download=auto
|
||||
do_autoconf=auto
|
||||
do_clean_workdir=no
|
||||
do_configure=auto
|
||||
do_make_clean=no
|
||||
do_make_all=yes
|
||||
do_make_check=yes
|
||||
do_make_install=yes
|
||||
|
||||
### command line parsing ###
|
||||
|
||||
usage() {
|
||||
cat >&2 <<EOF
|
||||
usage: `basename $0` [options ...] [var=value...] [<testname ...>]
|
||||
|
||||
-config <file> load the configuration from <file>
|
||||
-basedir <dir> set the base directory
|
||||
-srcdir <dir> select the directory where the source code is
|
||||
read from or will be downloaded to from CVS
|
||||
|
||||
-[dont-]download checkout or update from CVS (default: ${do_download})
|
||||
-[dont-]autoconf generate the configure script (default: ${do_autoconf})
|
||||
-[dont-]cleanwork recreate the build directory (default: ${do_clean_workdir})
|
||||
-[dont-]configure run configure (default: ${do_configure})
|
||||
-[dont-]clean make clean (default: ${do_make_clean})
|
||||
-[dont-]build make all (default: ${do_make_all})
|
||||
-[dont-]check make check (default: ${do_make_check})
|
||||
-[dont-]install make install (default: ${do_make_install})
|
||||
|
||||
-fast only do what's necessary
|
||||
-nice <n> set the nice(1) value (default: ${mc_nice_value})
|
||||
-maxlines <n> the maximum number of lines for each phase (default: ${mc_maxlines})
|
||||
-quiet disable most status messages (default: ${quiet:-"no"}${quiet+"yes"})
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
eval_arg() {
|
||||
_shquote_var=`echo x"$1" | sed -e '1s,^x\([^=]*\)=.*,\1,' -e '1q'`
|
||||
_shquote_val=`echo x"$1" | sed '1s,^x[^=]*=\(.*\),\1,'`
|
||||
_shquote_qval=`echo x"${_shquote_val}" | sed -e '1s,.,,' -e s,\',\'\\\\\\\\\'\',g`
|
||||
eval "${_shquote_var}='${_shquote_qval}'"
|
||||
}
|
||||
|
||||
while test $# -ne 0; do
|
||||
case "$1" in
|
||||
-config) shift; case "$1" in /*) . "$1";; *) . "./$1";; esac; shift;;
|
||||
-basedir) shift; mc_basedir="$1"; shift;;
|
||||
-cvs-repository) shift; mc_cvs_repository="$1"; shift;;
|
||||
-cvs-module) shift; mc_cvs_module="$1"; shift;;
|
||||
-srcdir) shift; mc_srcdir="$1"; shift;;
|
||||
|
||||
-cleanup) shift; do_clean_basedir=yes;;
|
||||
|
||||
-download) shift; do_download=yes;;
|
||||
-dont-download) shift; do_download=no;;
|
||||
-autoconf) shift; do_autoconf=yes;;
|
||||
-dont-autoconf) shift; do_autoconf=no;;
|
||||
-cleanwork) shift; do_clean_workdir=yes;;
|
||||
-dont-cleanwork) shift; do_clean_workdir=no;;
|
||||
-configure) shift; do_configure=yes;;
|
||||
-dont-configure) shift; do_configure=no;;
|
||||
-clean) shift; do_make_clean=yes;;
|
||||
-dont-clean) shift; do_make_clean=no;;
|
||||
-build) shift; do_make_all=yes;;
|
||||
-dont-build) shift; do_make_all=no;;
|
||||
-check) shift; do_make_check=yes;;
|
||||
-dont-check) shift; do_make_check=no;;
|
||||
-install) shift; do_make_install=yes;;
|
||||
-dont-install) shift; do_make_install=no;;
|
||||
|
||||
-fast) shift; do_clean_workdir=no
|
||||
do_autoconf=no
|
||||
do_configure=no
|
||||
do_make_clean=no
|
||||
do_make_all=yes;;
|
||||
-nice) shift; mc_nice_value="$1"; shift;;
|
||||
-maxlines) shift; mc_maxlines="$1"; shift;;
|
||||
-quiet) shift; quiet="yes";;
|
||||
mc_*=*) eval_arg "$1"; shift;;
|
||||
|
||||
--) shift; break;;
|
||||
-) shift; break;;
|
||||
-*) usage;;
|
||||
*) break;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
### Initialization ###
|
||||
|
||||
renice ${mc_nice_value} $$ 1>/dev/null 2>&1 || true
|
||||
|
||||
### Tools ###
|
||||
|
||||
configure_args_enable_all="--enable-largefile --enable-nls "\
|
||||
"--enable-background --enable-charset "\
|
||||
"--with-mmap --with-included-gettext --with-x "\
|
||||
"--enable-vfs --enable-vfs-smb --enable-vfs-undelfs "\
|
||||
"--with-gpm-mouse --with-subshell --with-edit"
|
||||
configure_args_disable_all="--disable-largefile --disable-nls "\
|
||||
"--disable-background --disable-charset "\
|
||||
"--without-mmap --without-included-gettext --without-x "\
|
||||
"--disable-vfs --disable-vfs-smb --disable-vfs-undelfs "\
|
||||
"--without-gpm-mouse --without-subshell --without-edit"
|
||||
|
||||
errors=0
|
||||
warnings=0
|
||||
|
||||
# feature tests
|
||||
if test x"`echo -n`" = x"-n"; then
|
||||
echo_n="echo"
|
||||
echo_cont=" " # a tab character
|
||||
else
|
||||
echo_n="echo -n"
|
||||
echo_cont=" "
|
||||
fi
|
||||
|
||||
|
||||
show_file() {
|
||||
if test -f "$1"; then
|
||||
echo ""
|
||||
sed -e "${mc_maxlines}s,.*,(more lines follow ...)," -e "${mc_maxlines}q" "$1"
|
||||
echo ""
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
phase_start() {
|
||||
${echo_n} "[`date`] $1"
|
||||
return 0
|
||||
}
|
||||
|
||||
phase_ok() {
|
||||
echo "${echo_cont}ok"
|
||||
return 0
|
||||
}
|
||||
|
||||
phase_warnings() {
|
||||
echo "${echo_cont}WARNINGS"
|
||||
warnings=`expr $warnings + 1`
|
||||
if test $# -gt 0; then show_file "$1"; fi
|
||||
return 0
|
||||
}
|
||||
|
||||
phase_ok_or_warnings() {
|
||||
fsize=`wc -c < "$1"`
|
||||
|
||||
{ test -n "${fsize}" && test ${fsize} -eq 0
|
||||
} && phase_ok || phase_warnings "$1"
|
||||
return 0
|
||||
}
|
||||
|
||||
phase_failed() {
|
||||
echo "${echo_cont}FAILED"
|
||||
failed=yes
|
||||
errors=`expr $errors + 1`
|
||||
if test $# -gt 0; then show_file "$1"; fi
|
||||
return 0
|
||||
}
|
||||
|
||||
setup_preconf_env=\
|
||||
"out=\"\${mc_logdir}/\${test_phase}.out\";"\
|
||||
"err=\"\${mc_logdir}/\${test_phase}.err\";"
|
||||
|
||||
preconf_download() {
|
||||
test_phase="download"
|
||||
eval "${setup_preconf_env}"
|
||||
|
||||
if test ${do_download} = no && test -d "${mc_srcdir}/CVS"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
mkdir -p "${mc_logdir}"
|
||||
|
||||
if test -d "${mc_srcdir}/CVS"; then
|
||||
phase_start "updating CVS copy ..."
|
||||
( cd "${mc_srcdir}" \
|
||||
&& env CVS_RSH=${mc_cvs_rsh} cvs update -r "${mc_cvs_tag}" -dP
|
||||
) 1>"${out}" 2>"${err}" && phase_ok_or_warnings "${err}" || phase_failed "${err}"
|
||||
else
|
||||
phase_start "getting fresh CVS copy ..."
|
||||
( mkdir -p "${mc_srcdir}" \
|
||||
&& cd "${mc_srcdir}/.." \
|
||||
&& env CVS_RSH=${mc_cvs_rsh} cvs -d "${mc_cvs_repository}" checkout -P -r "${mc_cvs_tag}" -d "`basename "${mc_srcdir}"`" "${mc_cvs_module}"
|
||||
) 1>"${out}" 2>"${err}" && phase_ok_or_warnings "${err}" || phase_failed "${err}"
|
||||
fi
|
||||
}
|
||||
|
||||
preconf_autoconf() {
|
||||
test_phase="autoconf"
|
||||
eval "${setup_preconf_env}"
|
||||
|
||||
if test ${do_autoconf} != yes && test -f "${mc_srcdir}/configure"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
mkdir -p "${mc_logdir}"
|
||||
|
||||
phase_start "creating ./configure script ..."
|
||||
{ cd "${mc_srcdir}" \
|
||||
&& echo "#!/bin/sh" > ./configure.mc \
|
||||
&& chmod +x ./configure.mc \
|
||||
&& ${SHELL-"/bin/sh"} ./autogen.sh
|
||||
} 1>"${out}" 2>"${err}" && phase_ok_or_warnings "${err}" || phase_failed "${err}"
|
||||
}
|
||||
|
||||
setup_testenv=\
|
||||
"test_srcdir=\"\${mc_srcdir}\";"\
|
||||
"test_workdir=\"\${mc_builddir}/\${testname}\";"\
|
||||
"test_prefix=\"\${mc_prefixdir}/\${testname}\";"\
|
||||
"test_logdir=\"\${mc_logdir}/\${testname}\";"\
|
||||
"out=\"\${test_logdir}/\${test_phase}.out\";"\
|
||||
"err=\"\${test_logdir}/\${test_phase}.err\";"
|
||||
|
||||
confbuild_cleanwork() {
|
||||
test_phase="cleanwork"
|
||||
eval "${setup_testenv}"
|
||||
|
||||
if test ${do_clean_workdir} = no || test ! -d "${test_workdir}"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
mkdir -p "${test_logdir}"
|
||||
|
||||
phase_start "cleaning directory for ${testname} ..."
|
||||
{ rm -rf "${test_workdir}"
|
||||
} 1>"${out}" 2>"${err}" && phase_ok_or_warnings "${err}" || phase_failed "${err}"
|
||||
}
|
||||
|
||||
confbuild_configure() {
|
||||
test_phase="configure"
|
||||
eval "${setup_testenv}"
|
||||
|
||||
if test ${do_configure} != yes && test -f "${test_workdir}/Makefile"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
mkdir -p "${test_logdir}"
|
||||
|
||||
phase_start "configuring for ${testname} ..."
|
||||
( set -e
|
||||
mkdir -p "${test_workdir}"
|
||||
cd "${test_workdir}"
|
||||
cmd="${test_srcdir}/configure"
|
||||
cmd="${cmd} --prefix=\"${test_prefix}\""
|
||||
cmd="${cmd} MAKE=\"${mc_make}\""
|
||||
cmd="${cmd} CPP=\"${mc_cpp}\""
|
||||
cmd="${cmd} CPPFLAGS=\"${mc_cppflags}\""
|
||||
cmd="${cmd} CC=\"${mc_cc}\""
|
||||
cmd="${cmd} CFLAGS=\"${mc_cflags}\""
|
||||
cmd="${cmd} LDFLAGS=\"${mc_ldflags}\""
|
||||
cmd="${cmd} ${mc_configure_args_pre}"
|
||||
cmd="${cmd} ${configure_args}"
|
||||
cmd="${cmd} ${mc_configure_args_post}"
|
||||
echo "running $cmd"
|
||||
eval "$cmd"
|
||||
) 1>"${out}" 2>"${err}" && phase_ok_or_warnings "${err}" || phase_failed "${err}"
|
||||
}
|
||||
|
||||
confbuild_make() {
|
||||
make_target="$1"
|
||||
test_phase="make_${make_target}"
|
||||
eval "${setup_testenv}"
|
||||
|
||||
if eval "test \${do_make_${make_target}} = no"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
mkdir -p "${test_logdir}"
|
||||
|
||||
phase_start "running \"make ${make_target}\" for ${testname} ..."
|
||||
( cd "${test_workdir}" \
|
||||
&& eval "${mc_make} ${mc_make_flags} ${make_target}"
|
||||
) 1>"${out}" 2>"${err}" && phase_ok_or_warnings "${err}" || phase_failed "${err}"
|
||||
}
|
||||
|
||||
confbuild() {
|
||||
failed=no
|
||||
|
||||
confbuild_cleanwork
|
||||
if test ${failed} = yes; then return 0; fi
|
||||
|
||||
confbuild_configure
|
||||
if test ${failed} = yes; then return 0; fi
|
||||
|
||||
confbuild_make "clean"
|
||||
if test ${failed} = yes; then return 0; fi
|
||||
|
||||
confbuild_make "all"
|
||||
if test ${failed} = yes; then return 0; fi
|
||||
|
||||
confbuild_make "check"
|
||||
if test ${failed} = yes; then return 0; fi
|
||||
|
||||
confbuild_make "install"
|
||||
if test ${failed} = yes; then return 0; fi
|
||||
}
|
||||
|
||||
|
||||
test_plain() {
|
||||
testname="plain"
|
||||
configure_args=""
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_charset() {
|
||||
testname="charset"
|
||||
configure_args="--enable-charset"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_no_charset() {
|
||||
testname="no_charset"
|
||||
configure_args="--disable-charset"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_X11() {
|
||||
testname="X11"
|
||||
configure_args="--with-x"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_no_X11() {
|
||||
testname="no_X11"
|
||||
configure_args="--without-x"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_vfs() {
|
||||
testname="vfs"
|
||||
configure_args="--enable-vfs"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_no_vfs() {
|
||||
testname="no_vfs"
|
||||
configure_args="--disable-vfs"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_samba() {
|
||||
testname="samba"
|
||||
configure_args="--enable-vfs-smb"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_no_samba() {
|
||||
testname="no_samba"
|
||||
configure_args="--disable-vfs-smb"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_ext2undel() {
|
||||
testname="ext2undel"
|
||||
configure_args="--enable-vfs-undelfs"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_no_ext2undel() {
|
||||
testname="no_ext2undel"
|
||||
configure_args="--disable-vfs-undelfs"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_slang() {
|
||||
testname="slang"
|
||||
configure_args="--with-screen=slang"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_ncurses() {
|
||||
testname="ncurses"
|
||||
configure_args="--with-screen=ncurses"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_maintainer() {
|
||||
testname="maintainer"
|
||||
configure_args="--enable-maintainer-mode"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_no_maintainer() {
|
||||
testname="no_maintainer"
|
||||
configure_args="--disable-maintainer-mode"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_i18n() {
|
||||
testname="i18n"
|
||||
configure_args="--enable-nls"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_no_i18n() {
|
||||
testname="no_i18n"
|
||||
configure_args="--disable-nls"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_no_features() {
|
||||
testname="no_features"
|
||||
configure_args="${configure_args_disable_all}"
|
||||
confbuild
|
||||
}
|
||||
|
||||
test_all_features() {
|
||||
testname="all_features"
|
||||
configure_args="${configure_args_enable_all}"
|
||||
confbuild
|
||||
}
|
||||
|
||||
run_tests() {
|
||||
failed=no
|
||||
|
||||
preconf_download
|
||||
if test ${failed} = yes; then return 0; fi
|
||||
|
||||
preconf_autoconf
|
||||
if test ${failed} = yes; then return 0; fi
|
||||
|
||||
for i in "$@"; do
|
||||
if type test_"${i}" 2>/dev/null \
|
||||
| grep "function" 1>/dev/null 2>&1; then
|
||||
eval "test_${i}"
|
||||
else
|
||||
echo "[`date`] test \"$i\" not found." 1>&2
|
||||
errors=`expr $errors + 1`
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if test -z "${mc_srcdir}"; then mc_srcdir="${mc_basedir}/src"; fi
|
||||
if test -z "${mc_prefixdir}"; then mc_prefixdir="${mc_basedir}/installed"; fi
|
||||
if test -z "${mc_builddir}"; then mc_builddir="${mc_basedir}/build"; fi
|
||||
if test -z "${mc_logdir}"; then mc_logdir="${mc_basedir}/logs"; fi
|
||||
if test -z "${mc_cpp}"; then mc_cpp="${mc_cc} -E"; fi
|
||||
|
||||
if test ${do_clean_basedir} = yes; then
|
||||
phase_start "cleaning up everything ..."
|
||||
{ rm -rf "${mc_basedir}"
|
||||
} && phase_ok || phase_failed
|
||||
else
|
||||
if test $# -gt 0; then
|
||||
mc_tests="$@"
|
||||
fi
|
||||
run_tests $mc_tests
|
||||
fi
|
||||
|
||||
if test ${errors} -ne 0 || test ${warnings} -ne 0; then
|
||||
echo "[`date`] finished with ${errors} errors and ${warnings} warnings."
|
||||
else
|
||||
echo "[`date`] finished successfully."
|
||||
fi
|
||||
exit ${errors}
|
@ -1,65 +0,0 @@
|
||||
# This is an example configuration for the mc-test test suite.
|
||||
# It has all options commented out, as they are equal to the default
|
||||
# values used by the test suite.
|
||||
#
|
||||
|
||||
# See the nice(1) man page for details.
|
||||
#mc_nice_value="19"
|
||||
# Number of initial lines that are printed when an action fails or
|
||||
# emits warnings.
|
||||
#mc_maxlines="10"
|
||||
|
||||
# This is the directory everything happens in. All directories that are
|
||||
# given as "" will later be replaced with the value given in the comment.
|
||||
# This is necessary for the command line to work.
|
||||
# * srcdir is the directory where the sources are downloaded
|
||||
# * builddir is the directory mc is built in
|
||||
# * prefixdir is the directory mc is installed in
|
||||
* * logdir is the directory the log files are written to
|
||||
#mc_basedir="/tmp/mc-current-build"
|
||||
#mc_srcdir="" # default: ${mc_basedir}/src
|
||||
#mc_builddir="" # default: ${mc_basedir}/build
|
||||
#mc_prefixdir="" # default: ${mc_basedir}/installed
|
||||
#mc_logdir="" # default: ${mc_basedir}/logs
|
||||
|
||||
#mc_cvs_rsh="ssh"
|
||||
#mc_cvs_repository=":ext:anoncvs@cvs.gnu.org:/cvsroot/mc"
|
||||
#mc_cvs_module="mc"
|
||||
#mc_cvs_tag="HEAD"
|
||||
|
||||
# The "pre" arguments can be overridden by the test cases,
|
||||
# the "post" arguments cannot.
|
||||
#mc_configure_args_pre="--enable-maintainer-mode"
|
||||
#mc_configure_args_post=""
|
||||
|
||||
#mc_make="make"
|
||||
#mc_make_flags=""
|
||||
|
||||
# The C preprocessor used for building mc.
|
||||
#mc_cpp="" # default: ${mc_cc} -E
|
||||
#mc_cppflags=""
|
||||
|
||||
# The C compiler used for building mc.
|
||||
#mc_cc="cc"
|
||||
#mc_cflags=""
|
||||
|
||||
# Additional linker flags, like library directories.
|
||||
#mc_ldflags=""
|
||||
|
||||
# The list of tests that will be run.
|
||||
#mc_tests="plain glib12 charset no_charset vfs no_vfs samba "\
|
||||
#"no_samba ext2undel no_ext2undel slang ncurses maintainer "\
|
||||
#"no_maintainer i18n no_i18n no_features all_features"
|
||||
|
||||
# This cleans mc_basedir and all its subdirectories. Any directories outside
|
||||
# mc_basedir are not touched.
|
||||
#do_clean_basedir=no
|
||||
|
||||
# You can enable or disable the different phases of the build process.
|
||||
#do_download=auto
|
||||
#do_autoconf=auto
|
||||
#do_clean_workdir=no
|
||||
#do_configure=auto
|
||||
#do_make_clean=no
|
||||
#do_make_all=yes
|
||||
#do_make_install=yes
|
108
maint/mcsnap
108
maint/mcsnap
@ -1,108 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
# This script takes the compiled tarball, makes an RPM package and
|
||||
# a patch against the latest released version, then uploads
|
||||
# everything over ssh and removes old snapshots.
|
||||
# Run this script in the directory where mc was built.
|
||||
|
||||
# TODO:
|
||||
# build tarball, select level of testing
|
||||
# (dist, distcheck, warning checks)
|
||||
|
||||
|
||||
# $1 - file to upload, $2 - shell mask to erase
|
||||
upload() {
|
||||
echo "Uploading $1 to $SITE"
|
||||
name="`basename $1`"
|
||||
scp "$1" "$SITE:$DIR/.in.$name"
|
||||
ssh $SITE "rm -f $DIR/$2; mv $DIR/.in.$name $DIR/$name"
|
||||
}
|
||||
|
||||
set -e
|
||||
|
||||
# Version to make patches against.
|
||||
# The source tree should be available in uncompressed form
|
||||
BASE_VERSION="4.6.1"
|
||||
|
||||
# Version of the snapshot
|
||||
MCVERSION=`date "+%Y-%m-%d-%H" --utc`
|
||||
|
||||
# Local directories
|
||||
MC_BASE_DIR="$HOME/src/mc-$BASE_VERSION"
|
||||
MC_CVS_DIR="$HOME/src/mc"
|
||||
MC_BUILD_DIR="$HOME/src/mc.snap"
|
||||
RPM_SRC_DIR="$MC_BUILD_DIR/rpm"
|
||||
|
||||
# Location of the snapshot directory
|
||||
SITE="login.ibiblio.org"
|
||||
DIR="/public/ftp/pub/Linux/utils/file/managers/mc/snapshots"
|
||||
# DIR="/public/html/mc/snapshots"
|
||||
|
||||
# Command for building RPM
|
||||
RPMBUILD=lsb-rpm
|
||||
|
||||
cd "$MC_CVS_DIR"
|
||||
cvs up -dPA
|
||||
test -d "$MC_BUILD_DIR" && chmod -R u+rwx "$MC_BUILD_DIR"
|
||||
rm -rf "$MC_BUILD_DIR"
|
||||
cp -a "$MC_CVS_DIR" "$MC_BUILD_DIR"
|
||||
cd "$MC_BUILD_DIR"
|
||||
|
||||
# Sanity check
|
||||
if ! test -f ./autogen.sh || ! test -f src/screen.c; then
|
||||
echo "Not in the MC CVS working directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Remove old tarballs and build the new one
|
||||
rm -f "mc*.tar.gz"
|
||||
cp -f configure.ac configure.ac.cvs
|
||||
sed "s/AM_INIT_AUTOMAKE([^)]*)/AM_INIT_AUTOMAKE(mc, $MCVERSION)/" \
|
||||
configure.ac.cvs >configure.ac
|
||||
./autogen.sh
|
||||
make all
|
||||
make distcheck
|
||||
|
||||
# Make sure that the new tarball exists
|
||||
MCTARBALL="mc-$MCVERSION.tar.gz"
|
||||
if test ! -f "$MCTARBALL"; then
|
||||
echo "No tarball found!!!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make an RPM package
|
||||
rm -rf $RPM_SRC_DIR
|
||||
mkdir "$RPM_SRC_DIR"
|
||||
mkdir "$RPM_SRC_DIR/BUILD"
|
||||
mkdir "$RPM_SRC_DIR/RPMS"
|
||||
mkdir "$RPM_SRC_DIR/RPMS/i386"
|
||||
mkdir "$RPM_SRC_DIR/SPECS"
|
||||
$RPMBUILD -tb --define="_topdir $RPM_SRC_DIR" \
|
||||
"$MCTARBALL"
|
||||
MC_RPM_VERSION=`echo $MCVERSION | sed s/-//g`
|
||||
MC_RPM=$RPM_SRC_DIR/RPMS/i386/mc-$MC_RPM_VERSION-1.i386.rpm
|
||||
if test ! -f $MC_RPM; then
|
||||
echo "Failed to compile package!!!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make a patch against the latest released version
|
||||
MC_PATCH="mc-$BASE_VERSION-$MCVERSION.diff"
|
||||
MC_PATCH_BZ2="$MC_PATCH.bz2"
|
||||
if test ! -d $MC_BASE_DIR; then
|
||||
echo "Cannot find unpacked base version!!!"
|
||||
exit 1
|
||||
fi
|
||||
rm -f $MC_PATCH $MC_PATCH_BZ2
|
||||
rm -rf mc-$MCVERSION
|
||||
gzip -cd $MCTARBALL | tar xf -
|
||||
|
||||
# GNU diff should return 0 or 1. 2 means failure or incomplete diff.
|
||||
diff -urN -x '*.gmo' -x pc $MC_BASE_DIR mc-$MCVERSION/ >$MC_PATCH || test $? = 1
|
||||
bzip2 $MC_PATCH
|
||||
|
||||
upload "$MCTARBALL" "mc*.tar.gz"
|
||||
upload "$MC_RPM" "mc*.i386.rpm"
|
||||
upload "$MC_PATCH_BZ2" "mc*.diff.bz2"
|
||||
|
||||
echo "Done"
|
75
maint/mctest
75
maint/mctest
@ -1,75 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This is the testsuite for GNU Midnight Commander.
|
||||
# Maintainer doing the release must ensure that this testsuite passes.
|
||||
|
||||
set -e
|
||||
|
||||
trap 'echo >&2 "ERROR: Test not completed, exit with code $?"; exit 1' exit
|
||||
|
||||
distcheck() {
|
||||
id="$1"
|
||||
shift
|
||||
make distcheck "$MAKEFLAGS" "$@" >test-$id.out 2>test-$id.err
|
||||
}
|
||||
|
||||
# Specify which warnings we want to see.
|
||||
# Don't add options that produce massive warnings.
|
||||
# Add -Wstrict-prototypes after main.h is fixed (always use cpanel).
|
||||
# Maybe add -W if a better way to initialize quick dialogs is found.
|
||||
export CFLAGS="-O2 -Wall -Wno-unused-parameter -Wno-sign-compare \
|
||||
-Wmissing-declarations -Wmissing-prototypes -Wbad-function-cast \
|
||||
-Wcast-align -Wpointer-arith -Wredundant-decls -Wundef -Wfloat-equal"
|
||||
|
||||
# Suppress progress indicator
|
||||
MAKEFLAGS='MSGMERGE_FLAGS=--no-location --quiet'
|
||||
|
||||
echo "Checking the documentation"
|
||||
maint/doctest
|
||||
|
||||
echo "Bootstraping from CVS"
|
||||
./autogen.sh >test-autogen.out 2>test-autogen.err
|
||||
|
||||
echo "Checking configure"
|
||||
bash -n configure 2>test-configure.err
|
||||
|
||||
echo "Making everything in the source directory"
|
||||
make all >test0.out 2>test0.err
|
||||
|
||||
echo "Checking the default configuration"
|
||||
distcheck 1
|
||||
|
||||
echo "Checking the configuration with maximal code coverage"
|
||||
distcheck 2 enable_charset=yes with_samba=yes \
|
||||
with_included_gettext=yes
|
||||
|
||||
echo "Checking the configuration with minimal code coverage"
|
||||
distcheck 3 enable_largefile=no enable_nls=no with_vfs=no \
|
||||
with_gpm_mouse=no with_subshell=no with_edit=no with_ext2undel=no \
|
||||
with_screen=ncurses with_x=no enable_background=no
|
||||
|
||||
echo "Checking the configuration with minimal code coverage + editor"
|
||||
distcheck 4 enable_largefile=no enable_nls=no with_vfs=no \
|
||||
with_gpm_mouse=no with_subshell=no with_ext2undel=no \
|
||||
with_screen=ncurses
|
||||
|
||||
echo "Checking the configuration with experimental and rarely used options"
|
||||
distcheck 5 with_mmap=no with_subshell=optional
|
||||
|
||||
RPMBUILD=/usr/bin/rpmbuild
|
||||
if test -x $RPMBUILD; then
|
||||
echo "Building RPM package"
|
||||
RPM_SRC_DIR="`pwd`/rpm"
|
||||
rm -rf $RPM_SRC_DIR
|
||||
mkdir "$RPM_SRC_DIR"
|
||||
mkdir "$RPM_SRC_DIR/BUILD"
|
||||
mkdir "$RPM_SRC_DIR/RPMS"
|
||||
mkdir "$RPM_SRC_DIR/RPMS/`$RPMBUILD --eval='%{_host_cpu}' 2>/dev/null`"
|
||||
mkdir "$RPM_SRC_DIR/SPECS"
|
||||
$RPMBUILD -tb --define="_topdir $RPM_SRC_DIR" mc-*.tar.gz >test-rpm.out 2>test-rpm.err
|
||||
else
|
||||
echo "rpmbuild not found"
|
||||
fi
|
||||
|
||||
trap - exit
|
||||
echo "All done. No fatal errors. Please check test*.err files."
|
@ -1,37 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Generate mc.pot, upload it and *.po files to the FTP directory.
|
||||
|
||||
set -e
|
||||
|
||||
if ! test -d po; then
|
||||
echo "Run this script in the top level source directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DOMAIN=mc
|
||||
COPYRIGHT_HOLDER="Free Software Foundation, Inc."
|
||||
XGETTEXT_OPTIONS="--keyword=_ --keyword=N_ --keyword=Q_"
|
||||
XGETTEXT=xgettext
|
||||
MSGMERGE=msgmerge
|
||||
|
||||
files=`find . -name '*.[ch]' | xargs $XGETTEXT $XGETTEXT_OPTIONS --output=- | \
|
||||
sed -ne '/^#:/{s/#://;s/:[0-9]*/\n/g;s/ //g;p;}' | sort -u`
|
||||
|
||||
$XGETTEXT --default-domain=$DOMAIN --directory=. \
|
||||
--add-comments=TRANSLATORS: $XGETTEXT_OPTIONS \
|
||||
--copyright-holder="$COPYRIGHT_HOLDER" --output=po/new-mc.pot $files
|
||||
|
||||
for file in po/*.po; do
|
||||
$MSGMERGE --output=po/new-`basename $file` $file po/new-mc.pot
|
||||
done
|
||||
|
||||
# Location of the snapshot directory
|
||||
SITE="login.ibiblio.org"
|
||||
DIR="/public/ftp/pub/Linux/utils/file/managers/mc/po"
|
||||
|
||||
scp po/new-* "$SITE:$DIR/"
|
||||
|
||||
ssh $SITE "cd $DIR; for file in new-*; do mv -f \$file \${file#new-}; done"
|
||||
|
||||
rm -f po/new-*
|
@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "test src/*"
|
||||
for i in `find src -name '*.[ch]'`; do
|
||||
./maint/dupincludes.pl $i
|
||||
done
|
||||
|
||||
echo "test lib/*"
|
||||
for i in `find lib -name '*.[ch]'`; do
|
||||
./maint/dupincludes.pl $i
|
||||
done
|
||||
|
76
maint/utils/doctest
Исполняемый файл
76
maint/utils/doctest
Исполняемый файл
@ -0,0 +1,76 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Midnight Commander - check the documentation for compatibility with groff and nroff.
|
||||
#
|
||||
# Copyright (C) 2002, 2003, 2011, 2013
|
||||
# The Free Software Foundation, Inc.
|
||||
#
|
||||
# Written by:
|
||||
# Pavel Roskin <proski@gnu.org> 2002, 2003
|
||||
# Ilia Maslakov <il.smind@gmail.com>, 2011
|
||||
# Slava Zanko <slavazanko@gmail.com>, 2013
|
||||
#
|
||||
# This file is part of the Midnight Commander.
|
||||
#
|
||||
# The Midnight Commander is free software: you can redistribute it
|
||||
# and/or modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
#
|
||||
# The Midnight Commander is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#set -e
|
||||
|
||||
MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(pwd)))}
|
||||
|
||||
#*** include section (source functions, for example) *******************
|
||||
|
||||
#*** file scope functions **********************************************
|
||||
|
||||
one_test() {
|
||||
"$@" >/dev/null 2>doctest.err
|
||||
if test -s doctest.err; then
|
||||
echo "ERROR messages follow:" 2>&1
|
||||
cat doctest.err 2>&1
|
||||
echo "ERROR while running following command:" 2>&1
|
||||
echo "$@" 2>&1
|
||||
echo "ERROR messages are preserved in doctest.err"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
#*** main code *********************************************************
|
||||
|
||||
[ -r "${MC_SOURCE_ROOT_DIR}/doc/man/mc.1.in" ] || {
|
||||
echo "ERROR: cannot read doc/mc.1.in" 2>&1
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Test the documentation for possible errors.
|
||||
for i in $(find "${MC_SOURCE_ROOT_DIR}/doc" -name '*.[1-9].in'); do
|
||||
echo "test (groff): $i"
|
||||
|
||||
preconv -e UTF8 "${i}" | \
|
||||
groff -wall -mandoc -Tutf8 | \
|
||||
grep "warning:"
|
||||
done
|
||||
|
||||
for i in $(find "${MC_SOURCE_ROOT_DIR}/doc" -name '*.[1-9].in'); do
|
||||
echo "test (nroff): $i"
|
||||
|
||||
preconv -e UTF8 "${i}" | \
|
||||
nroff -Tutf8 -mandoc | \
|
||||
grep "warning:"
|
||||
done
|
||||
|
||||
# Check the English manuals to be in ASCII.
|
||||
one_test find "${MC_SOURCE_ROOT_DIR}/doc" -maxdepth 1 -name '*.[1-9].in' -exec groff -wall -Tascii {} \;
|
||||
|
||||
rm -rf doctest.err
|
||||
exit 0
|
3
maint/utils/find-dup-includes/exclude-list.cfg
Обычный файл
3
maint/utils/find-dup-includes/exclude-list.cfg
Обычный файл
@ -0,0 +1,3 @@
|
||||
src/filemanager/mountlist.c
|
||||
src/vfs/smbfs/helpers/lib/netmask.c
|
||||
lib/tty/key.c
|
@ -34,18 +34,20 @@ if (!open (FILE, "$filename")) {
|
||||
exit 1;
|
||||
}
|
||||
|
||||
my $lineno=1;
|
||||
foreach (<FILE>) {
|
||||
if (/^\s*#\s*include\s*<(.*)>/) {
|
||||
if (defined $sys_includes{$1}) {
|
||||
print "$filename: duplicate <$1>\n";
|
||||
print "$filename:$lineno: duplicate <$1> (line no ".$sys_includes{$1}.")\n";
|
||||
} else {
|
||||
$sys_includes{$1} = 1;
|
||||
$sys_includes{$1} = $lineno;
|
||||
}
|
||||
} elsif (/^\s*#\s*include\s*"(.*)"/) {
|
||||
if (defined $loc_includes{$1}) {
|
||||
print "$filename: duplicate \"$1\"\n";
|
||||
print "$filename:$lineno: duplicate \"$1\" (line no ".$loc_includes{$1}.")\n";
|
||||
} else {
|
||||
$loc_includes{$1} = 1;
|
||||
$loc_includes{$1} = $lineno;
|
||||
}
|
||||
}
|
||||
$lineno++;
|
||||
}
|
49
maint/utils/find-dup-includes/runme.sh
Исполняемый файл
49
maint/utils/find-dup-includes/runme.sh
Исполняемый файл
@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Midnight Commander - find an 'include' duplicates in src/ and lib/ subdirs
|
||||
#
|
||||
# Copyright (C) 2011, 2013
|
||||
# The Free Software Foundation, Inc.
|
||||
#
|
||||
# Written by:
|
||||
# Ilia Maslakov <il.smind@gmail.com>, 2011
|
||||
# Yury V. Zaytsev <yury@shurup.com>, 2011
|
||||
# Slava Zanko <slavazanko@gmail.com>, 2013
|
||||
#
|
||||
# This file is part of the Midnight Commander.
|
||||
#
|
||||
# The Midnight Commander is free software: you can redistribute it
|
||||
# and/or modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
#
|
||||
# The Midnight Commander is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(dirname $(pwd))))}
|
||||
|
||||
#*** include section (source functions, for example) *******************
|
||||
|
||||
#*** file scope functions **********************************************
|
||||
|
||||
findIncludeDupsInDir() {
|
||||
dir_name=$1; shift
|
||||
|
||||
for i in $(find "${dir_name}" -name '*.[ch]'); do
|
||||
file_name=$(echo $i | sed 's@'"${MC_SOURCE_ROOT_DIR}/"'@@g')
|
||||
[ $(grep "^\s*${file_name}$" -c "${MC_SOURCE_ROOT_DIR}/maint/utils/find-dup-includes/exclude-list.cfg") -ne 0 ] && continue
|
||||
"${MC_SOURCE_ROOT_DIR}/maint/utils/find-dup-includes/find-in-one-file.pl" "${i}"
|
||||
done
|
||||
}
|
||||
|
||||
#*** main code *********************************************************
|
||||
|
||||
findIncludeDupsInDir "${MC_SOURCE_ROOT_DIR}/src"
|
||||
findIncludeDupsInDir "${MC_SOURCE_ROOT_DIR}/lib"
|
29
maint/utils/sync-transifex/README.txt
Обычный файл
29
maint/utils/sync-transifex/README.txt
Обычный файл
@ -0,0 +1,29 @@
|
||||
|
||||
== Pre-requirements ==
|
||||
|
||||
=== List of required apps ===
|
||||
|
||||
* tx (A transifex client. http://help.transifex.com/features/client/#user-client-08-install)
|
||||
* po4a (A tool maintaining translations anywhere. http://alioth.debian.org/projects/po4a/)
|
||||
|
||||
|
||||
=== An artifacts configuration ===
|
||||
|
||||
Put in the ~/.transifexrc file these lines:
|
||||
|
||||
[https://www.transifex.net]
|
||||
hostname = https://www.transifex.net
|
||||
username = YourTxLogin
|
||||
password = YourTxPassword
|
||||
token =
|
||||
|
||||
== Interact with Transifex via scripts ==
|
||||
|
||||
To get all translations from Transifex run:
|
||||
|
||||
find ./ -name '*-fromTransifex.*' -exec {} \;
|
||||
|
||||
To put source files to Transifex run:
|
||||
|
||||
find ./ -name '*-toTransifex.*' -exec {} \;
|
||||
|
2
maint/utils/sync-transifex/config.d/po/po-ignore.list
Обычный файл
2
maint/utils/sync-transifex/config.d/po/po-ignore.list
Обычный файл
@ -0,0 +1,2 @@
|
||||
it.po
|
||||
ru.po
|
8
maint/utils/sync-transifex/config.d/po/tx.config
Обычный файл
8
maint/utils/sync-transifex/config.d/po/tx.config
Обычный файл
@ -0,0 +1,8 @@
|
||||
[main]
|
||||
host = http://www.transifex.net
|
||||
|
||||
[mc.mcpot]
|
||||
file_filter = <lang>.po
|
||||
source_file = mc.pot
|
||||
source_lang = en
|
||||
|
@ -50,7 +50,7 @@ getConfigFile() {
|
||||
sync_file_name=$1; shift
|
||||
config_file_name=$1; shift
|
||||
|
||||
echo "${MC_SOURCE_ROOT_DIR}/maint/sync-transifex/config.d/${sync_file_name}/${config_file_name}"
|
||||
echo "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/config.d/${sync_file_name}/${config_file_name}"
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------
|
@ -25,11 +25,11 @@
|
||||
|
||||
set -e
|
||||
|
||||
MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(pwd)))}
|
||||
MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(dirname $(dirname $(pwd))))}
|
||||
|
||||
#*** include section (source functions, for example) *******************
|
||||
|
||||
source "${MC_SOURCE_ROOT_DIR}/maint/sync-transifex/functions"
|
||||
source "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/functions"
|
||||
|
||||
#*** file scope functions **********************************************
|
||||
|
@ -25,11 +25,11 @@
|
||||
|
||||
set -e
|
||||
|
||||
MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(pwd)))}
|
||||
MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(dirname $(dirname $(pwd))))}
|
||||
|
||||
#*** include section (source functions, for example) *******************
|
||||
|
||||
source "${MC_SOURCE_ROOT_DIR}/maint/sync-transifex/functions"
|
||||
source "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/functions"
|
||||
|
||||
#*** file scope functions **********************************************
|
||||
|
67
maint/utils/sync-transifex/po-fromTransifex.sh
Исполняемый файл
67
maint/utils/sync-transifex/po-fromTransifex.sh
Исполняемый файл
@ -0,0 +1,67 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Midnight Commander - fetch doc/hints/mc.hint translations from Transifex
|
||||
#
|
||||
# Copyright (C) 2013
|
||||
# The Free Software Foundation, Inc.
|
||||
#
|
||||
# Written by:
|
||||
# Slava Zanko <slavazanko@gmail.com>, 2013
|
||||
#
|
||||
# This file is part of the Midnight Commander.
|
||||
#
|
||||
# The Midnight Commander is free software: you can redistribute it
|
||||
# and/or modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
#
|
||||
# The Midnight Commander is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set -e
|
||||
|
||||
MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(dirname $(dirname $(pwd))))}
|
||||
|
||||
#*** include section (source functions, for example) *******************
|
||||
|
||||
source "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/functions"
|
||||
|
||||
#*** file scope functions **********************************************
|
||||
|
||||
stripLocation() {
|
||||
work_dir=$1; shift
|
||||
|
||||
for i in $(find "${work_dir}" -name '*.po' -print); do
|
||||
sed -i '/^#:/d' "${i}"
|
||||
done
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
copyFilesToSourceDir() {
|
||||
work_dir=$1; shift
|
||||
source_dir=$1; shift
|
||||
|
||||
exclude_list_file=$(getConfigFile "po" "po-ignore.list")
|
||||
|
||||
for i in $(find "${work_dir}" -name '*.po' -print | sort); do
|
||||
[ $(grep -c "^\s*$(basename ${i})" "${exclude_list_file}") -ne 1 ] && {
|
||||
cp -f "${i}" "${source_dir}"
|
||||
}
|
||||
done
|
||||
}
|
||||
|
||||
#*** main code *********************************************************
|
||||
|
||||
WORK_DIR=$(initSyncDirIfNeeded "po")
|
||||
|
||||
receiveTranslationsFromTransifex "${WORK_DIR}"
|
||||
|
||||
stripLocation "${WORK_DIR}"
|
||||
|
||||
copyFilesToSourceDir "${WORK_DIR}" "${MC_SOURCE_ROOT_DIR}/po"
|
50
maint/utils/sync-transifex/po-toTransifex.sh
Исполняемый файл
50
maint/utils/sync-transifex/po-toTransifex.sh
Исполняемый файл
@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Midnight Commander - push doc/hints/mc.hint file to Transifex
|
||||
#
|
||||
# Copyright (C) 2013
|
||||
# The Free Software Foundation, Inc.
|
||||
#
|
||||
# Written by:
|
||||
# Slava Zanko <slavazanko@gmail.com>, 2013
|
||||
#
|
||||
# This file is part of the Midnight Commander.
|
||||
#
|
||||
# The Midnight Commander is free software: you can redistribute it
|
||||
# and/or modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
#
|
||||
# The Midnight Commander is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set -e
|
||||
|
||||
MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(dirname $(pwd))))}
|
||||
|
||||
#*** include section (source functions, for example) *******************
|
||||
|
||||
source "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/functions"
|
||||
|
||||
#*** file scope functions **********************************************
|
||||
|
||||
copyPotToWorkDir() {
|
||||
work_dir=$1; shift
|
||||
source_dir=$1; shift
|
||||
|
||||
cp -f "${source_dir}/mc.pot" "${work_dir}"
|
||||
}
|
||||
|
||||
#*** main code *********************************************************
|
||||
|
||||
WORK_DIR=$(initSyncDirIfNeeded "po")
|
||||
|
||||
copyPotToWorkDir "${WORK_DIR}" "${MC_SOURCE_ROOT_DIR}/po"
|
||||
|
||||
sendSourceToTransifex "${WORK_DIR}"
|
||||
|
79
maint/utils/version.sh
Исполняемый файл
79
maint/utils/version.sh
Исполняемый файл
@ -0,0 +1,79 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Midnight Commander - calculate current version
|
||||
#
|
||||
# Copyright (C) 2009, 2010, 2013
|
||||
# The Free Software Foundation, Inc.
|
||||
#
|
||||
# Written by:
|
||||
# Slava Zanko <slavazanko@gmail.com>, 2009, 2010, 2013
|
||||
# Stan. S. Krupoderov <pashelper@gmail.com>, 2009
|
||||
# Sergei Trofimovich <slyfox@inbox.ru>, 2009
|
||||
# Oswald Buddenhagen <ossi@kde.org>, 2009
|
||||
#
|
||||
# This file is part of the Midnight Commander.
|
||||
#
|
||||
# The Midnight Commander is free software: you can redistribute it
|
||||
# and/or modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
#
|
||||
# The Midnight Commander is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#*** include section (source functions, for example) *******************
|
||||
|
||||
#*** file scope functions **********************************************
|
||||
|
||||
mc_print_version(){
|
||||
|
||||
if [ ! -f "${VERSION_FILE}" \
|
||||
-o "${PREV_MC_VERSION}" != "${CURR_MC_VERSION}" ]
|
||||
then
|
||||
cat >"${VERSION_FILE}" <<EOF
|
||||
#ifndef MC_CURRENT_VERSION
|
||||
/* This is an autogenerated file. Don't edit! */
|
||||
#define MC_CURRENT_VERSION "${CURR_MC_VERSION}"
|
||||
#endif
|
||||
EOF
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
#*** main code *********************************************************
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "usage: $0 <toplevel-source-dir>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
src_top_dir="$1"
|
||||
|
||||
VERSION_FILE="${src_top_dir}/version.h"
|
||||
PREV_MC_VERSION="unknown"
|
||||
CURR_MC_VERSION="${PREV_MC_VERSION}"
|
||||
|
||||
if [ -r "${VERSION_FILE}" ]
|
||||
then
|
||||
PREV_MC_VERSION=`sed -n 's/^#define MC_CURRENT_VERSION "\(.*\)"$/\1/p' "${VERSION_FILE}"`
|
||||
CURR_MC_VERSION="${PREV_MC_VERSION}"
|
||||
fi
|
||||
|
||||
git_head=`git --git-dir "${src_top_dir}/.git" rev-parse --verify HEAD 2>/dev/null`
|
||||
[ -z "${git_head}" ] && mc_print_version
|
||||
|
||||
# try to store sha1
|
||||
CURR_MC_VERSION="${git_head}"
|
||||
|
||||
new_version=`git --git-dir "${src_top_dir}/.git" describe 2>/dev/null`
|
||||
[ -z "${new_version}" ] && mc_print_version
|
||||
|
||||
# store pretty tagged version
|
||||
CURR_MC_VERSION="${new_version}"
|
||||
mc_print_version
|
@ -1,47 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "usage: $0 <toplevel-source-dir>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
src_top_dir="$1"
|
||||
|
||||
VERSION_FILE="${src_top_dir}/version.h"
|
||||
PREV_MC_VERSION="unknown"
|
||||
CURR_MC_VERSION="${PREV_MC_VERSION}"
|
||||
|
||||
if [ -r "${VERSION_FILE}" ]
|
||||
then
|
||||
PREV_MC_VERSION=`sed -n 's/^#define MC_CURRENT_VERSION "\(.*\)"$/\1/p' "${VERSION_FILE}"`
|
||||
CURR_MC_VERSION="${PREV_MC_VERSION}"
|
||||
fi
|
||||
|
||||
mc_print_version(){
|
||||
|
||||
if [ ! -f "${VERSION_FILE}" \
|
||||
-o "${PREV_MC_VERSION}" != "${CURR_MC_VERSION}" ]
|
||||
then
|
||||
cat >"${VERSION_FILE}" <<EOF
|
||||
#ifndef MC_CURRENT_VERSION
|
||||
/* This is an autogenerated file. Don't edit! */
|
||||
#define MC_CURRENT_VERSION "${CURR_MC_VERSION}"
|
||||
#endif
|
||||
EOF
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
git_head=`git --git-dir "${src_top_dir}/.git" rev-parse --verify HEAD 2>/dev/null`
|
||||
[ -z "${git_head}" ] && mc_print_version
|
||||
|
||||
# try to store sha1
|
||||
CURR_MC_VERSION="${git_head}"
|
||||
|
||||
new_version=`git --git-dir "${src_top_dir}/.git" describe 2>/dev/null`
|
||||
[ -z "${new_version}" ] && mc_print_version
|
||||
|
||||
# store pretty tagged version
|
||||
CURR_MC_VERSION="${new_version}"
|
||||
mc_print_version
|
@ -149,10 +149,10 @@ do_open_action() {
|
||||
msppt)
|
||||
if [ -n "$DISPLAY" ]; then
|
||||
OOFFICE=`get_ooffice_executable`
|
||||
(${OOFFICE} %f >/dev/null 2>&1 &)
|
||||
(${OOFFICE} "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
|
||||
else
|
||||
tmp=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX`
|
||||
ppthtml %f > "$tmp/page.html"
|
||||
ppthtml "${MC_EXT_FILENAME}" > "$tmp/page.html"
|
||||
elinks "$tmp/page.html"
|
||||
rm -rf "$tmp"
|
||||
fi
|
||||
|
@ -17,7 +17,7 @@ do_view_action() {
|
||||
sed -n '/^Title/,/^Comment/p;/^MPEG/,/^Audio/p'
|
||||
;;
|
||||
ogg)
|
||||
ogginfo "${MC_EXT_SELECTED}"
|
||||
ogginfo "${MC_EXT_FILENAME}"
|
||||
;;
|
||||
wma)
|
||||
mplayer -quiet -slave -frames 0 -vo null -ao null -identify "${MC_EXT_FILENAME}" 2>/dev/null | \
|
||||
|
@ -1,37 +0,0 @@
|
||||
The update.pl script is included here. This script should be run like
|
||||
this:
|
||||
|
||||
./update.pl [OPTIONS] ...LANGCODE
|
||||
|
||||
By default, this script updates the pot file (the po template generated
|
||||
from the source code) and merges it with the po files (translations).
|
||||
|
||||
For instance to do this for Danish, type the following
|
||||
|
||||
./update.pl da
|
||||
|
||||
|
||||
The update.pl script also supports other options, they are:
|
||||
|
||||
-V, --version shows the version
|
||||
-H, --help shows this help page
|
||||
-P, --pot only generates the potfile
|
||||
-M, --maintain search for missing files in POTFILES.in
|
||||
|
||||
Especially the --maintain option is very handy for package maintainers
|
||||
to check if you included all the files that have marked strings in the
|
||||
POTFILES.in, so they will be in the generated pot file (po template).
|
||||
|
||||
You should make sure that the files found by the update.pl script are
|
||||
either distributed or always create during the build process. Otherwise
|
||||
"make distcheck" may fail preventing the release.
|
||||
|
||||
The script supports the --help option for further help, though its not
|
||||
very extensive for the moment.
|
||||
|
||||
Kenneth Christiansen
|
||||
|
||||
kenneth@gnu.org
|
||||
kenneth@gnome.org
|
||||
|
||||
update.pl is are copyright 2000 The Free Software Foundation and me.
|
10
po/mc.pot
10
po/mc.pot
@ -880,7 +880,7 @@ msgstr ""
|
||||
#: src/args.c:409
|
||||
msgid ""
|
||||
"\n"
|
||||
"Please send any bug reports (including the output of `mc -V')\n"
|
||||
"Please send any bug reports (including the output of 'mc -V')\n"
|
||||
"as tickets at www.midnight-commander.org\n"
|
||||
msgstr ""
|
||||
|
||||
@ -2051,7 +2051,7 @@ msgstr ""
|
||||
|
||||
#: src/execute.c:487
|
||||
#, c-format
|
||||
msgid "Type `exit' to return to the Midnight Commander"
|
||||
msgid "Type 'exit' to return to the Midnight Commander"
|
||||
msgstr ""
|
||||
|
||||
#: src/filemanager/achown.c:94 src/filemanager/chmod.c:121
|
||||
@ -2781,7 +2781,7 @@ msgstr ""
|
||||
|
||||
#: src/filemanager/cmd.c:1381
|
||||
#, c-format
|
||||
msgid "Symlink `%s' points to:"
|
||||
msgid "Symlink '%s' points to:"
|
||||
msgstr ""
|
||||
|
||||
#: src/filemanager/cmd.c:1388
|
||||
@ -2800,7 +2800,7 @@ msgstr ""
|
||||
|
||||
#: src/filemanager/cmd.c:1421
|
||||
#, c-format
|
||||
msgid "`%s' is not a symbolic link"
|
||||
msgid "'%s' is not a symbolic link"
|
||||
msgstr ""
|
||||
|
||||
#: src/filemanager/cmd.c:1515
|
||||
@ -3425,7 +3425,7 @@ msgstr ""
|
||||
|
||||
#: src/filemanager/filegui.c:1265
|
||||
#, c-format
|
||||
msgid "Invalid source pattern `%s'"
|
||||
msgid "Invalid source pattern '%s'"
|
||||
msgstr ""
|
||||
|
||||
#: src/filemanager/find.c:186
|
||||
|
10
po/ru.po
10
po/ru.po
@ -706,7 +706,7 @@ msgstr "Задать начальную строку для встроенног
|
||||
|
||||
msgid ""
|
||||
"\n"
|
||||
"Please send any bug reports (including the output of `mc -V')\n"
|
||||
"Please send any bug reports (including the output of 'mc -V')\n"
|
||||
"as tickets at www.midnight-commander.org\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
@ -1600,7 +1600,7 @@ msgid "The shell is already running a command"
|
||||
msgstr "Интерпретатор занят выполнением команды"
|
||||
|
||||
#, c-format
|
||||
msgid "Type `exit' to return to the Midnight Commander"
|
||||
msgid "Type 'exit' to return to the Midnight Commander"
|
||||
msgstr "Введите exit для возврата в Midnight Commander"
|
||||
|
||||
msgid "Set &all"
|
||||
@ -2157,7 +2157,7 @@ msgstr ""
|
||||
"панели не могут быть отключены."
|
||||
|
||||
#, c-format
|
||||
msgid "Symlink `%s' points to:"
|
||||
msgid "Symlink '%s' points to:"
|
||||
msgstr "Символическая ссылка %s указывает на:"
|
||||
|
||||
msgid "Edit symlink"
|
||||
@ -2172,7 +2172,7 @@ msgid "edit symlink: %s"
|
||||
msgstr "правка символической ссылки: %s"
|
||||
|
||||
#, c-format
|
||||
msgid "`%s' is not a symbolic link"
|
||||
msgid "'%s' is not a symbolic link"
|
||||
msgstr "%s не является символической ссылкой"
|
||||
|
||||
msgid "FTP to machine"
|
||||
@ -2748,7 +2748,7 @@ msgid "&Background"
|
||||
msgstr "В &фоне"
|
||||
|
||||
#, c-format
|
||||
msgid "Invalid source pattern `%s'"
|
||||
msgid "Invalid source pattern '%s'"
|
||||
msgstr "Неправильный образец \"%s\""
|
||||
|
||||
msgid "&Chdir"
|
||||
|
@ -1,30 +0,0 @@
|
||||
#! /usr/bin/env perl
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $first = 1;
|
||||
|
||||
foreach my $f (@ARGV) {
|
||||
my ($lang, $translated, $fuzzy, $untranslated) = (undef, 0, 0, 0);
|
||||
|
||||
# statistics are printed on stderr, as well as error messages.
|
||||
my $stat = `msgfmt --statistics "$f" 2>&1`;
|
||||
($lang = $f) =~ s,\.po$,,;
|
||||
if ($stat =~ qr"(\d+)\s+translated") {
|
||||
$translated = $1;
|
||||
}
|
||||
if ($stat =~ qr"(\d+)\s+fuzzy") {
|
||||
$fuzzy = $1;
|
||||
}
|
||||
if ($stat =~ qr"(\d+)\s+untranslated") {
|
||||
$untranslated = $1;
|
||||
}
|
||||
if ($first) {
|
||||
printf("%8s %10s %5s %12s\n",
|
||||
"language", "translated", "fuzzy", "untranslated");
|
||||
printf("%s\n", "-" x 43);
|
||||
$first = 0;
|
||||
}
|
||||
printf("%8s %10d %5d %12d\n",
|
||||
$lang, $translated, $fuzzy, $untranslated);
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
#! /bin/sh
|
||||
set -e
|
||||
|
||||
for i in "$@"; do
|
||||
i="./$i"
|
||||
sed '/^#:/d' < "$i" > "$i.tmp"
|
||||
mv -f "$i.tmp" "$i"
|
||||
done
|
167
po/update.pl
167
po/update.pl
@ -1,167 +0,0 @@
|
||||
#!/usr/bin/env perl
|
||||
use warnings;
|
||||
|
||||
# GNOME po update utility.
|
||||
# (C) 2000 The Free Software Foundation
|
||||
#
|
||||
# Author(s): Kenneth Christiansen
|
||||
|
||||
|
||||
$VERSION = "1.2.5 beta 2";
|
||||
$LANG = $ARGV[0];
|
||||
$PACKAGE = "mc";
|
||||
|
||||
if (! $LANG){
|
||||
print "update.pl: missing file arguments\n";
|
||||
print "Try `update.pl --help' for more information.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($LANG=~/^-(.)*/){
|
||||
|
||||
if ("$LANG" eq "--version" || "$LANG" eq "-V"){
|
||||
print "GNOME PO Updater $VERSION\n";
|
||||
print "Written by Kenneth Christiansen <kenneth\@gnome.org>, 2000.\n\n";
|
||||
print "Copyright (C) 2000 Free Software Foundation, Inc.\n";
|
||||
print "This is free software; see the source for copying conditions. There is NO\n";
|
||||
print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
elsif ($LANG eq "--help" || "$LANG" eq "-H"){
|
||||
print "Usage: ./update.pl [OPTIONS] ...LANGCODE\n";
|
||||
print "Updates pot files and merge them with the translations.\n\n";
|
||||
print " -V, --version shows the version\n";
|
||||
print " -H, --help shows this help page\n";
|
||||
print " -P, --pot only generates the potfile\n";
|
||||
print " -M, --maintain search for missing files in POTFILES.in\n";
|
||||
print "\nExamples of use:\n";
|
||||
print "update.sh --pot just creates a new pot file from the source\n";
|
||||
print "update.sh da created new pot file and updated the da.po file\n\n";
|
||||
print "Report bugs to <kenneth\@gnome.org>.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
elsif($LANG eq "--pot" || "$LANG" eq "-P"){
|
||||
|
||||
print "Building the $PACKAGE.pot ...";
|
||||
|
||||
$b="xgettext --default-domain\=$PACKAGE --directory\=\.\."
|
||||
." --add-comments=TRANSLATORS: --keyword\=\_ --keyword\=N\_"
|
||||
." --keyword\=Q\_ --files-from\=\.\/POTFILES\.in ";
|
||||
$b1="test \! -f $PACKAGE\.po \|\| \( rm -f \.\/$PACKAGE\.pot "
|
||||
."&& mv $PACKAGE\.po \.\/$PACKAGE\.pot \)";
|
||||
|
||||
`$b`;
|
||||
`$b1`;
|
||||
|
||||
print "...done\n";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
elsif ($LANG eq "--maintain" || "$LANG" eq "-M"){
|
||||
|
||||
$a="find ../ -type f -print | egrep '.*\\.(c|y|cc|c++|cxx|cpp|h|gob)\$' ";
|
||||
|
||||
open(BUF2, "POTFILES.in") || die "update.pl: there is no POTFILES.in !!!\n";
|
||||
print "Searching for missing _(\" \") entries...\n";
|
||||
open(BUF1, "$a|");
|
||||
|
||||
|
||||
@buf2 = <BUF2>;
|
||||
@buf1 = <BUF1>;
|
||||
|
||||
if (-s "POTFILES.ignore"){
|
||||
open FILE, "POTFILES.ignore";
|
||||
while (<FILE>) {
|
||||
if ($_=~/^[^#]/o){
|
||||
push @bup, $_;
|
||||
}
|
||||
}
|
||||
print "POTFILES.ignore found! Ignoring files...\n";
|
||||
@buf2 = (@bup, @buf2);
|
||||
}
|
||||
|
||||
foreach my $file (@buf1){
|
||||
open FILE, "<$file";
|
||||
while (<FILE>) {
|
||||
if ($_=~/_\s*\(\"/o){
|
||||
$file = unpack("x4 A*",$file) . "\n";
|
||||
push @buff1, $file;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@bufff1 = sort (@buff1);
|
||||
|
||||
@bufff2 = sort (@buf2);
|
||||
|
||||
my %in2;
|
||||
foreach (@bufff2) {
|
||||
$in2{$_} = 1;
|
||||
}
|
||||
|
||||
foreach (@bufff1){
|
||||
if (!exists($in2{$_})){
|
||||
push @result, $_ }
|
||||
}
|
||||
|
||||
if(@result){
|
||||
open OUT, ">POTFILES.in.missing";
|
||||
print OUT @result;
|
||||
print "\nHere are the results:\n\n", @result, "\n";
|
||||
print "File POTFILES.in.missing is being placed in directory...\n";
|
||||
print "Please add the files that should be ignored in POTFILES.ignore\n";
|
||||
}
|
||||
else{
|
||||
print "\nWell, it's all perfect! Congratulation!\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else{
|
||||
print "update.pl: invalid option -- $LANG\n";
|
||||
print "Try `update.pl --help' for more information.\n";
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
elsif(-s "$LANG.po"){
|
||||
|
||||
print "Building the $PACKAGE.pot ...";
|
||||
|
||||
$c="xgettext --default-domain\=$PACKAGE --directory\=\.\."
|
||||
." --add-comments=TRANSLATORS: --keyword\=\_ --keyword\=N\_"
|
||||
." --keyword\=Q\_ --files-from\=\.\/POTFILES\.in ";
|
||||
$c1="test \! -f $PACKAGE\.po \|\| \( rm -f \.\/$PACKAGE\.pot "
|
||||
."&& mv $PACKAGE\.po \.\/$PACKAGE\.pot \)";
|
||||
|
||||
`$c`;
|
||||
`$c1`;
|
||||
|
||||
print "...done";
|
||||
|
||||
print "\nNow merging $LANG.po with $PACKAGE.pot, and creating an updated $LANG.po ...\n";
|
||||
|
||||
|
||||
$d="mv $LANG.po $LANG.po.old && msgmerge --no-location $LANG.po.old $PACKAGE.pot -o $LANG.po";
|
||||
|
||||
$f="msgfmt --statistics $LANG.po";
|
||||
|
||||
`$d`;
|
||||
`$f`;
|
||||
|
||||
unlink "messages";
|
||||
unlink "$LANG.po.old";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
else{
|
||||
print "update.pl: sorry, $LANG.po doesn't exist!\n";
|
||||
print "Try `update.pl --help' for more information.\n";
|
||||
exit;
|
||||
}
|
74
po/update.sh
74
po/update.sh
@ -1,74 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
PACKAGE="mc"
|
||||
|
||||
if [ "x$1" = "x--help" ]; then
|
||||
|
||||
echo Usage: ./update.sh langcode
|
||||
echo --help display this help and exit
|
||||
echo --missing search for missing files in POTFILES.in
|
||||
echo
|
||||
echo Examples of use:
|
||||
echo ./update.sh ----- just creates a new pot file from the source
|
||||
echo ./update.sh da -- created new pot file and updated the da.po file
|
||||
|
||||
elif [ "x$1" = "x--missing" ]; then
|
||||
|
||||
echo "Searching for files containing _( ) but missing in POTFILES.in..."
|
||||
find ../ -regex '.*\.[c|y|cc|c++|h]' | xargs grep _\( | cut -d: -f1 | uniq | cut -d/ -f2- > POTFILES.in.missing
|
||||
|
||||
echo Sorting... comparing...
|
||||
sort -d POTFILES.in -o POTFILES.in
|
||||
sort -d POTFILES.in.missing -o POTFILES.in.missing
|
||||
|
||||
diff POTFILES.in POTFILES.in.missing -u0 | grep '^+' |grep -v '^+++'|grep -v '^@@' > POTFILES.in.missing
|
||||
|
||||
if [ -s POTFILES.in.missing ]; then
|
||||
echo && echo "Here are the results:"
|
||||
echo && cat POTFILES.in.missing
|
||||
echo && echo "File POTFILES.in.missing is being placed in directory..."
|
||||
|
||||
else
|
||||
|
||||
echo &&echo "There are no missing files, thanks God!"
|
||||
rm POTFILES.in.missing
|
||||
|
||||
fi
|
||||
|
||||
elif [ "x$1" = "x" ]; then
|
||||
|
||||
echo "Building the $PACKAGE.pot ..."
|
||||
|
||||
xgettext --default-domain=$PACKAGE --directory=.. \
|
||||
--add-comments=TRANSLATORS: --keyword=_ --keyword=N_ \
|
||||
--keyword=Q_ --files-from=./POTFILES.in \
|
||||
&& test ! -f $PACKAGE.po \
|
||||
|| ( rm -f ./$PACKAGE.pot \
|
||||
&& mv $PACKAGE.po ./$PACKAGE.pot );
|
||||
|
||||
else
|
||||
|
||||
if [ -s $1.po ]; then
|
||||
|
||||
xgettext --default-domain=$PACKAGE --directory=.. \
|
||||
--add-comments=TRANSLATORS: --keyword=_ --keyword=N_ \
|
||||
--keyword=Q_ --files-from=./POTFILES.in \
|
||||
&& test ! -f $PACKAGE.po \
|
||||
|| ( rm -f ./PACKAGE.pot \
|
||||
&& mv $PACKAGE.po ./$PACKAGE.pot );
|
||||
|
||||
echo "Building the $PACKAGE.pot ..."
|
||||
echo "Now merging $1.po with $PACKAGE.pot, and creating an updated $1.po ..."
|
||||
|
||||
mv $1.po $1.po.old && msgmerge --no-location $1.po.old $PACKAGE.pot -o $1.po \
|
||||
&& rm $1.po.old;
|
||||
|
||||
msgfmt --statistics $1.po
|
||||
|
||||
else
|
||||
|
||||
echo Sorry $1.po does not exist!
|
||||
|
||||
fi;
|
||||
|
||||
fi;
|
@ -407,7 +407,7 @@ mc_args_add_extended_info_to_help (void)
|
||||
mc_args__loc__footer_string = g_strdup_printf ("%s",
|
||||
_
|
||||
("\n"
|
||||
"Please send any bug reports (including the output of `mc -V')\n"
|
||||
"Please send any bug reports (including the output of 'mc -V')\n"
|
||||
"as tickets at www.midnight-commander.org\n"));
|
||||
mc_args__loc__header_string = g_strdup_printf (_("GNU Midnight Commander %s\n"), VERSION);
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
/*
|
||||
Copyright (C) 2007, 2010, 2011, 2012
|
||||
Copyright (C) 2007, 2010, 2011, 2012, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
Daniel Borca <dborca@yahoo.com>, 2007
|
||||
Slava Zanko <slavazanko@gmail.com>, 2010
|
||||
Slava Zanko <slavazanko@gmail.com>, 2010, 2013
|
||||
Andrew Borodin <aborodin@vmail.ru>, 2010, 2012
|
||||
Ilia Maslakov <il.smind@gmail.com>, 2010
|
||||
|
||||
@ -172,7 +172,7 @@ open_temp (void **name)
|
||||
_("Cannot create temporary diff file\n%s"), unix_error_string (errno));
|
||||
return -1;
|
||||
}
|
||||
*name = vfs_path_to_str (diff_file_name);
|
||||
*name = g_strdup (vfs_path_as_str (diff_file_name));
|
||||
vfs_path_free (diff_file_name);
|
||||
return fd;
|
||||
}
|
||||
@ -3618,21 +3618,11 @@ dview_diff_cmd (const void *f0, const void *f1)
|
||||
|
||||
GET_FILE_AND_STAMP (0);
|
||||
GET_FILE_AND_STAMP (1);
|
||||
if (real_file0 != NULL && real_file1 != NULL)
|
||||
{
|
||||
char *real_file0_str, *real_file1_str;
|
||||
char *file0_str, *file1_str;
|
||||
|
||||
real_file0_str = vfs_path_to_str (real_file0);
|
||||
real_file1_str = vfs_path_to_str (real_file1);
|
||||
file0_str = vfs_path_to_str (file0);
|
||||
file1_str = vfs_path_to_str (file1);
|
||||
rv = diff_view (real_file0_str, real_file1_str, file0_str, file1_str);
|
||||
g_free (real_file0_str);
|
||||
g_free (real_file1_str);
|
||||
g_free (file0_str);
|
||||
g_free (file1_str);
|
||||
}
|
||||
if (real_file0 != NULL && real_file1 != NULL)
|
||||
rv = diff_view (vfs_path_as_str (real_file0), vfs_path_as_str (real_file1),
|
||||
vfs_path_as_str (file0), vfs_path_as_str (file1));
|
||||
|
||||
UNGET_FILE (1);
|
||||
UNGET_FILE (0);
|
||||
}
|
||||
|
@ -164,7 +164,6 @@ extern int option_edit_left_extreme;
|
||||
extern int option_edit_top_extreme;
|
||||
extern int option_edit_bottom_extreme;
|
||||
|
||||
extern const char *option_whole_chars_search;
|
||||
extern gboolean search_create_bookmark;
|
||||
|
||||
extern char *edit_window_state_char;
|
||||
|
@ -100,7 +100,6 @@ int option_check_nl_at_eof = 0;
|
||||
int option_group_undo = 0;
|
||||
int show_right_margin = 0;
|
||||
|
||||
const char *option_whole_chars_search = "0123456789abcdefghijklmnopqrstuvwxyz_";
|
||||
char *option_backup_ext = NULL;
|
||||
|
||||
unsigned int edit_stack_iterator = 0;
|
||||
@ -121,7 +120,7 @@ const char VERTICAL_MAGIC[] = { '\1', '\1', '\1', '\1', '\n' };
|
||||
/* detecting an error on save is easy: just check if every byte has been written. */
|
||||
/* detecting an error on read, is not so easy 'cos there is not way to tell
|
||||
whether you read everything or not. */
|
||||
/* FIXME: add proper `triple_pipe_open' to read, write and check errors. */
|
||||
/* FIXME: add proper 'triple_pipe_open' to read, write and check errors. */
|
||||
static const struct edit_filters
|
||||
{
|
||||
const char *read, *write, *extension;
|
||||
@ -136,8 +135,6 @@ static const struct edit_filters
|
||||
/* *INDENT-ON* */
|
||||
};
|
||||
|
||||
static off_t last_bracket = -1;
|
||||
|
||||
/*** file scope functions ************************************************************************/
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
@ -211,11 +208,10 @@ edit_load_file_fast (WEdit * edit, const vfs_path_t * filename_vpath)
|
||||
file = mc_open (filename_vpath, O_RDONLY | O_BINARY);
|
||||
if (file == -1)
|
||||
{
|
||||
gchar *errmsg, *filename;
|
||||
gchar *errmsg;
|
||||
|
||||
filename = vfs_path_to_str (filename_vpath);
|
||||
errmsg = g_strdup_printf (_("Cannot open %s for reading"), filename);
|
||||
g_free (filename);
|
||||
errmsg =
|
||||
g_strdup_printf (_("Cannot open %s for reading"), vfs_path_as_str (filename_vpath));
|
||||
edit_error_dialog (_("Error"), errmsg);
|
||||
g_free (errmsg);
|
||||
return FALSE;
|
||||
@ -245,11 +241,9 @@ edit_load_file_fast (WEdit * edit, const vfs_path_t * filename_vpath)
|
||||
|
||||
if (!ret)
|
||||
{
|
||||
gchar *errmsg, *filename;
|
||||
gchar *errmsg;
|
||||
|
||||
filename = vfs_path_to_str (filename_vpath);
|
||||
errmsg = g_strdup_printf (_("Error reading %s"), filename);
|
||||
g_free (filename);
|
||||
errmsg = g_strdup_printf (_("Error reading %s"), vfs_path_as_str (filename_vpath));
|
||||
edit_error_dialog (_("Error"), errmsg);
|
||||
g_free (errmsg);
|
||||
}
|
||||
@ -264,24 +258,18 @@ static int
|
||||
edit_find_filter (const vfs_path_t * filename_vpath)
|
||||
{
|
||||
size_t i, l, e;
|
||||
char *filename;
|
||||
|
||||
if (filename_vpath == NULL)
|
||||
return -1;
|
||||
|
||||
filename = vfs_path_to_str (filename_vpath);
|
||||
l = strlen (filename);
|
||||
for (i = 0; i < sizeof (all_filters) / sizeof (all_filters[0]); i++)
|
||||
l = strlen (vfs_path_as_str (filename_vpath));
|
||||
for (i = 0; i < G_N_ELEMENTS (all_filters); i++)
|
||||
{
|
||||
e = strlen (all_filters[i].extension);
|
||||
if (l > e)
|
||||
if (!strcmp (all_filters[i].extension, filename + l - e))
|
||||
{
|
||||
g_free (filename);
|
||||
if (!strcmp (all_filters[i].extension, vfs_path_as_str (filename_vpath) + l - e))
|
||||
return i;
|
||||
}
|
||||
}
|
||||
g_free (filename);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -291,15 +279,13 @@ static char *
|
||||
edit_get_filter (const vfs_path_t * filename_vpath)
|
||||
{
|
||||
int i;
|
||||
char *p, *quoted_name, *filename;
|
||||
char *p, *quoted_name;
|
||||
|
||||
i = edit_find_filter (filename_vpath);
|
||||
if (i < 0)
|
||||
return NULL;
|
||||
|
||||
filename = vfs_path_to_str (filename_vpath);
|
||||
quoted_name = name_quote (filename, 0);
|
||||
g_free (filename);
|
||||
quoted_name = name_quote (vfs_path_as_str (filename_vpath), 0);
|
||||
p = g_strdup_printf (all_filters[i].read, quoted_name);
|
||||
g_free (quoted_name);
|
||||
return p;
|
||||
@ -347,11 +333,8 @@ check_file_access (WEdit * edit, const vfs_path_t * filename_vpath, struct stat
|
||||
file = mc_open (filename_vpath, O_NONBLOCK | O_RDONLY | O_BINARY | O_CREAT | O_EXCL, 0666);
|
||||
if (file < 0)
|
||||
{
|
||||
char *filename;
|
||||
|
||||
filename = vfs_path_to_str (filename_vpath);
|
||||
errmsg = g_strdup_printf (_("Cannot open %s for reading"), filename);
|
||||
g_free (filename);
|
||||
errmsg =
|
||||
g_strdup_printf (_("Cannot open %s for reading"), vfs_path_as_str (filename_vpath));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -362,22 +345,17 @@ check_file_access (WEdit * edit, const vfs_path_t * filename_vpath, struct stat
|
||||
/* Check what we have opened */
|
||||
if (mc_fstat (file, st) < 0)
|
||||
{
|
||||
char *filename;
|
||||
|
||||
filename = vfs_path_to_str (filename_vpath);
|
||||
errmsg = g_strdup_printf (_("Cannot get size/permissions for %s"), filename);
|
||||
g_free (filename);
|
||||
errmsg =
|
||||
g_strdup_printf (_("Cannot get size/permissions for %s"),
|
||||
vfs_path_as_str (filename_vpath));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* We want to open regular files only */
|
||||
if (!S_ISREG (st->st_mode))
|
||||
{
|
||||
char *filename;
|
||||
|
||||
filename = vfs_path_to_str (filename_vpath);
|
||||
errmsg = g_strdup_printf (_("\"%s\" is not a regular file"), filename);
|
||||
g_free (filename);
|
||||
errmsg =
|
||||
g_strdup_printf (_("\"%s\" is not a regular file"), vfs_path_as_str (filename_vpath));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -389,13 +367,7 @@ check_file_access (WEdit * edit, const vfs_path_t * filename_vpath, struct stat
|
||||
edit->delete_file = 0;
|
||||
|
||||
if (st->st_size >= SIZE_LIMIT)
|
||||
{
|
||||
char *filename;
|
||||
|
||||
filename = vfs_path_to_str (filename_vpath);
|
||||
errmsg = g_strdup_printf (_("File \"%s\" is too large"), filename);
|
||||
g_free (filename);
|
||||
}
|
||||
errmsg = g_strdup_printf (_("File \"%s\" is too large"), vfs_path_as_str (filename_vpath));
|
||||
|
||||
cleanup:
|
||||
(void) mc_close (file);
|
||||
@ -2285,33 +2257,6 @@ edit_init (WEdit * edit, int y, int x, int lines, int cols, const vfs_path_t * f
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef ENABLE_NLS
|
||||
/*
|
||||
* Expand option_whole_chars_search by national letters using
|
||||
* current locale
|
||||
*/
|
||||
|
||||
static char option_whole_chars_search_buf[256];
|
||||
|
||||
if (option_whole_chars_search_buf != option_whole_chars_search)
|
||||
{
|
||||
size_t i;
|
||||
size_t len = str_term_width1 (option_whole_chars_search);
|
||||
|
||||
strcpy (option_whole_chars_search_buf, option_whole_chars_search);
|
||||
|
||||
for (i = 1; i <= sizeof (option_whole_chars_search_buf); i++)
|
||||
{
|
||||
if (g_ascii_islower ((gchar) i) && !strchr (option_whole_chars_search, i))
|
||||
{
|
||||
option_whole_chars_search_buf[len++] = i;
|
||||
}
|
||||
}
|
||||
|
||||
option_whole_chars_search_buf[len] = 0;
|
||||
option_whole_chars_search = option_whole_chars_search_buf;
|
||||
}
|
||||
#endif /* ENABLE_NLS */
|
||||
edit = g_malloc0 (sizeof (WEdit));
|
||||
to_free = TRUE;
|
||||
|
||||
@ -2329,6 +2274,7 @@ edit_init (WEdit * edit, int y, int x, int lines, int cols, const vfs_path_t * f
|
||||
|
||||
edit->over_col = 0;
|
||||
edit->bracket = -1;
|
||||
edit->last_bracket = -1;
|
||||
edit->force |= REDRAW_PAGE;
|
||||
|
||||
/* set file name before load file */
|
||||
@ -3570,9 +3516,9 @@ void
|
||||
edit_find_bracket (WEdit * edit)
|
||||
{
|
||||
edit->bracket = edit_get_bracket (edit, 1, 10000);
|
||||
if (last_bracket != edit->bracket)
|
||||
if (edit->last_bracket != edit->bracket)
|
||||
edit->force |= REDRAW_PAGE;
|
||||
last_bracket = edit->bracket;
|
||||
edit->last_bracket = edit->bracket;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -73,7 +73,6 @@
|
||||
#endif
|
||||
#include "src/keybind-defaults.h"
|
||||
#include "src/util.h" /* check_for_default() */
|
||||
#include "src/filemanager/layout.h" /* mc_refresh() */
|
||||
|
||||
#include "edit-impl.h"
|
||||
#include "editwidget.h"
|
||||
@ -446,7 +445,6 @@ static vfs_path_t *
|
||||
edit_get_save_file_as (WEdit * edit)
|
||||
{
|
||||
static LineBreaks cur_lb = LB_ASIS;
|
||||
char *filename;
|
||||
char *filename_res;
|
||||
vfs_path_t *ret_vpath = NULL;
|
||||
|
||||
@ -457,12 +455,11 @@ edit_get_save_file_as (WEdit * edit)
|
||||
N_("&Macintosh format (CR)")
|
||||
};
|
||||
|
||||
filename = vfs_path_to_str (edit->filename_vpath);
|
||||
|
||||
{
|
||||
quick_widget_t quick_widgets[] = {
|
||||
/* *INDENT-OFF* */
|
||||
QUICK_LABELED_INPUT (N_("Enter file name:"), input_label_above, filename, "save-as",
|
||||
QUICK_LABELED_INPUT (N_("Enter file name:"), input_label_above,
|
||||
vfs_path_as_str (edit->filename_vpath), "save-as",
|
||||
&filename_res, NULL, FALSE, FALSE, INPUT_COMPLETE_FILENAMES),
|
||||
QUICK_SEPARATOR (TRUE),
|
||||
QUICK_LABEL (N_("Change line breaks to:"), NULL),
|
||||
@ -490,8 +487,6 @@ edit_get_save_file_as (WEdit * edit)
|
||||
}
|
||||
}
|
||||
|
||||
g_free (filename);
|
||||
|
||||
return ret_vpath;
|
||||
}
|
||||
|
||||
@ -2056,12 +2051,10 @@ edit_save_confirm_cmd (WEdit * edit)
|
||||
|
||||
if (edit_confirm_save)
|
||||
{
|
||||
char *filename;
|
||||
gboolean ok;
|
||||
|
||||
filename = vfs_path_to_str (edit->filename_vpath);
|
||||
f = g_strdup_printf (_("Confirm save file: \"%s\""), filename);
|
||||
g_free (filename);
|
||||
f = g_strdup_printf (_("Confirm save file: \"%s\""),
|
||||
vfs_path_as_str (edit->filename_vpath));
|
||||
ok = (edit_query_dialog2 (_("Save file"), f, _("&Save"), _("&Cancel")) == 0);
|
||||
g_free (f);
|
||||
if (!ok)
|
||||
@ -2791,7 +2784,7 @@ edit_ok_to_exit (WEdit * edit)
|
||||
return TRUE;
|
||||
|
||||
if (edit->filename_vpath != NULL)
|
||||
fname = vfs_path_to_str (edit->filename_vpath);
|
||||
fname = g_strdup (vfs_path_as_str (edit->filename_vpath));
|
||||
#ifdef ENABLE_NLS
|
||||
else
|
||||
fname = g_strdup (_(fname));
|
||||
|
@ -2,12 +2,13 @@
|
||||
Editor text drawing.
|
||||
|
||||
Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||
2007, 2011, 2012
|
||||
2007, 2011, 2012, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
Paul Sheer, 1996, 1997
|
||||
Andrew Borodin <aborodin@vmail.ru> 2012
|
||||
Slava Zanko <slavazanko@gmail.com>, 2013
|
||||
|
||||
This file is part of the Midnight Commander.
|
||||
|
||||
@ -260,12 +261,10 @@ edit_status_window (WEdit * edit)
|
||||
if (cols > 5)
|
||||
{
|
||||
const char *fname = N_("NoName");
|
||||
char *full_fname = NULL;
|
||||
|
||||
if (edit->filename_vpath != NULL)
|
||||
{
|
||||
full_fname = vfs_path_to_str (edit->filename_vpath);
|
||||
fname = x_basename (full_fname);
|
||||
fname = x_basename (vfs_path_as_str (edit->filename_vpath));
|
||||
}
|
||||
#ifdef ENABLE_NLS
|
||||
else
|
||||
@ -274,7 +273,6 @@ edit_status_window (WEdit * edit)
|
||||
|
||||
edit_move (2, 0);
|
||||
tty_printf ("[%s]", str_term_trim (fname, w->cols - 8 - 6));
|
||||
g_free (full_fname);
|
||||
}
|
||||
|
||||
tty_getyx (&y, &x);
|
||||
|
@ -145,7 +145,7 @@ edit_about (void)
|
||||
QUICK_LABEL (N_("A user friendly text editor\n"
|
||||
"written for the Midnight Commander."), NULL),
|
||||
QUICK_SEPARATOR (FALSE),
|
||||
QUICK_LABEL (N_("Copyright (C) 1996-2012 the Free Software Foundation"), NULL),
|
||||
QUICK_LABEL (N_("Copyright (C) 1996-2013 the Free Software Foundation"), NULL),
|
||||
QUICK_START_BUTTONS (TRUE, TRUE),
|
||||
QUICK_BUTTON (N_("&OK"), B_ENTER, NULL, NULL),
|
||||
QUICK_END
|
||||
@ -338,13 +338,9 @@ edit_window_list (const WDialog * h)
|
||||
if (e->filename_vpath == NULL)
|
||||
fname = g_strdup_printf ("%c [%s]", e->modified ? '*' : ' ', _("NoName"));
|
||||
else
|
||||
{
|
||||
char *fname2;
|
||||
|
||||
fname2 = vfs_path_to_str (e->filename_vpath);
|
||||
fname = g_strdup_printf ("%c%s", e->modified ? '*' : ' ', fname2);
|
||||
g_free (fname2);
|
||||
}
|
||||
fname =
|
||||
g_strdup_printf ("%c%s", e->modified ? '*' : ' ',
|
||||
vfs_path_as_str (e->filename_vpath));
|
||||
|
||||
listbox_add_item (listbox->list, LISTBOX_APPEND_AT_END, get_hotkey (i++),
|
||||
str_term_trim (fname, WIDGET (listbox->list)->cols - 2), NULL);
|
||||
@ -394,9 +390,11 @@ edit_get_title (const WDialog * h, size_t len)
|
||||
|
||||
len -= 4;
|
||||
|
||||
filename = vfs_path_to_str (edit->filename_vpath);
|
||||
if (filename == NULL)
|
||||
if (edit->filename_vpath == NULL)
|
||||
filename = g_strdup (_("[NoName]"));
|
||||
else
|
||||
filename = g_strdup (vfs_path_as_str (edit->filename_vpath));
|
||||
|
||||
file_label = str_term_trim (filename, len - str_term_width1 (_("Edit: ")));
|
||||
g_free (filename);
|
||||
|
||||
@ -1249,7 +1247,7 @@ edit_files (const GList * files)
|
||||
char *
|
||||
edit_get_file_name (const WEdit * edit)
|
||||
{
|
||||
return vfs_path_to_str (edit->filename_vpath);
|
||||
return g_strdup (vfs_path_as_str (edit->filename_vpath));
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
@ -1285,8 +1283,7 @@ edit_update_screen (WEdit * e)
|
||||
|
||||
edit_scroll_screen_over_cursor (e);
|
||||
edit_update_curs_col (e);
|
||||
|
||||
edit_status (e, (e->force & REDRAW_COMPLETELY) != 0 && (void *) e == h->current->data);
|
||||
edit_status (e, (void *) e == h->current->data);
|
||||
|
||||
/* pop all events for this window for internal handling */
|
||||
if (!is_idle ())
|
||||
|
@ -128,6 +128,7 @@ struct WEdit
|
||||
long column1; /* position of column highlight start */
|
||||
long column2; /* position of column highlight end */
|
||||
off_t bracket; /* position of a matching bracket */
|
||||
off_t last_bracket; /* previous position of a matching bracket */
|
||||
|
||||
/* cache speedup for line lookups */
|
||||
gboolean caches_valid;
|
||||
@ -167,8 +168,6 @@ struct WEdit
|
||||
/* line break */
|
||||
LineBreaks lb;
|
||||
gboolean extmod;
|
||||
|
||||
char *labels[10];
|
||||
};
|
||||
|
||||
/*** global variables defined in .c file *********************************************************/
|
||||
|
@ -2,12 +2,13 @@
|
||||
Editor syntax highlighting.
|
||||
|
||||
Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||
2007, 2010, 2011
|
||||
2007, 2010, 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
Paul Sheer, 1998
|
||||
Egmont Koblinger <egmont@gmail.com>, 2010
|
||||
Slava Zanko <slavazanko@gmail.com>, 2013
|
||||
|
||||
This file is part of the Midnight Commander.
|
||||
|
||||
@ -224,7 +225,7 @@ compare_word_to_right (const WEdit * edit, off_t i, const char *text,
|
||||
if ((line_start != 0 && c != '\n') || (whole_left != NULL && strchr (whole_left, c) != NULL))
|
||||
return -1;
|
||||
|
||||
for (p = (unsigned char *) text, q = p + str_term_width1 ((char *) p); p < q; p++, i++)
|
||||
for (p = (unsigned char *) text, q = p + strlen ((char *) p); p < q; p++, i++)
|
||||
{
|
||||
switch (*p)
|
||||
{
|
||||
@ -331,8 +332,8 @@ xx_strchr (const WEdit * edit, const unsigned char *s, int char_byte)
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static edit_syntax_rule_t
|
||||
apply_rules_going_right (WEdit * edit, off_t i, edit_syntax_rule_t rule)
|
||||
static void
|
||||
apply_rules_going_right (WEdit * edit, off_t i)
|
||||
{
|
||||
struct context_rule *r;
|
||||
int c;
|
||||
@ -341,15 +342,16 @@ apply_rules_going_right (WEdit * edit, off_t i, edit_syntax_rule_t rule)
|
||||
gboolean keyword_foundleft = FALSE, keyword_foundright = FALSE;
|
||||
gboolean is_end;
|
||||
off_t end = 0;
|
||||
edit_syntax_rule_t _rule = rule;
|
||||
edit_syntax_rule_t _rule = edit->rule;
|
||||
|
||||
c = xx_tolower (edit, edit_get_byte (edit, i));
|
||||
if (c == 0)
|
||||
return rule;
|
||||
is_end = (rule.end == i);
|
||||
return;
|
||||
|
||||
is_end = (edit->rule.end == i);
|
||||
|
||||
/* check to turn off a keyword */
|
||||
if (_rule.keyword)
|
||||
if (_rule.keyword != 0)
|
||||
{
|
||||
if (edit_get_byte (edit, i - 1) == '\n')
|
||||
_rule.keyword = 0;
|
||||
@ -361,12 +363,12 @@ apply_rules_going_right (WEdit * edit, off_t i, edit_syntax_rule_t rule)
|
||||
}
|
||||
|
||||
/* check to turn off a context */
|
||||
if (_rule.context && !_rule.keyword)
|
||||
if (_rule.context != 0 && _rule.keyword == 0)
|
||||
{
|
||||
off_t e;
|
||||
|
||||
r = edit->rules[_rule.context];
|
||||
if (r->first_right == c && !(rule.border & RULE_ON_RIGHT_BORDER)
|
||||
if (r->first_right == c && (edit->rule.border & RULE_ON_RIGHT_BORDER) == 0
|
||||
&& (e =
|
||||
compare_word_to_right (edit, i, r->right, r->whole_word_chars_left,
|
||||
r->whole_word_chars_right, r->line_start_right)) > 0)
|
||||
@ -377,7 +379,7 @@ apply_rules_going_right (WEdit * edit, off_t i, edit_syntax_rule_t rule)
|
||||
if (r->between_delimiters)
|
||||
_rule.context = 0;
|
||||
}
|
||||
else if (is_end && rule.border & RULE_ON_RIGHT_BORDER)
|
||||
else if (is_end && (edit->rule.border & RULE_ON_RIGHT_BORDER) != 0)
|
||||
{
|
||||
/* always turn off a context at 4 */
|
||||
found_left = TRUE;
|
||||
@ -385,7 +387,7 @@ apply_rules_going_right (WEdit * edit, off_t i, edit_syntax_rule_t rule)
|
||||
if (!keyword_foundleft)
|
||||
_rule.context = 0;
|
||||
}
|
||||
else if (is_end && rule.border & RULE_ON_LEFT_BORDER)
|
||||
else if (is_end && (edit->rule.border & RULE_ON_LEFT_BORDER) != 0)
|
||||
{
|
||||
/* never turn off a context at 2 */
|
||||
found_left = TRUE;
|
||||
@ -394,7 +396,7 @@ apply_rules_going_right (WEdit * edit, off_t i, edit_syntax_rule_t rule)
|
||||
}
|
||||
|
||||
/* check to turn on a keyword */
|
||||
if (!_rule.keyword)
|
||||
if (_rule.keyword == 0)
|
||||
{
|
||||
const char *p;
|
||||
|
||||
@ -424,11 +426,11 @@ apply_rules_going_right (WEdit * edit, off_t i, edit_syntax_rule_t rule)
|
||||
}
|
||||
|
||||
/* check to turn on a context */
|
||||
if (!_rule.context)
|
||||
if (_rule.context == 0)
|
||||
{
|
||||
if (!found_left && is_end)
|
||||
{
|
||||
if (rule.border & RULE_ON_RIGHT_BORDER)
|
||||
if ((edit->rule.border & RULE_ON_RIGHT_BORDER) != 0)
|
||||
{
|
||||
_rule.border = 0;
|
||||
_rule.context = 0;
|
||||
@ -436,7 +438,7 @@ apply_rules_going_right (WEdit * edit, off_t i, edit_syntax_rule_t rule)
|
||||
_rule.keyword = 0;
|
||||
|
||||
}
|
||||
else if (rule.border & RULE_ON_LEFT_BORDER)
|
||||
else if ((edit->rule.border & RULE_ON_LEFT_BORDER) != 0)
|
||||
{
|
||||
r = edit->rules[_rule._context];
|
||||
_rule.border = 0;
|
||||
@ -469,7 +471,7 @@ apply_rules_going_right (WEdit * edit, off_t i, edit_syntax_rule_t rule)
|
||||
int count;
|
||||
struct context_rule **rules = edit->rules;
|
||||
|
||||
for (count = 1; rules[count]; count++)
|
||||
for (count = 1; rules[count] != NULL; count++)
|
||||
{
|
||||
r = rules[count];
|
||||
if (r->first_left == c)
|
||||
@ -478,13 +480,13 @@ apply_rules_going_right (WEdit * edit, off_t i, edit_syntax_rule_t rule)
|
||||
|
||||
e = compare_word_to_right (edit, i, r->left, r->whole_word_chars_left,
|
||||
r->whole_word_chars_right, r->line_start_left);
|
||||
if (e >= end && (!_rule.keyword || keyword_foundright))
|
||||
if (e >= end && (_rule.keyword == 0 || keyword_foundright))
|
||||
{
|
||||
_rule.end = e;
|
||||
found_right = TRUE;
|
||||
_rule.border = RULE_ON_LEFT_BORDER;
|
||||
_rule._context = count;
|
||||
if (!r->between_delimiters && !_rule.keyword)
|
||||
if (!r->between_delimiters && _rule.keyword == 0)
|
||||
{
|
||||
_rule.context = count;
|
||||
contextchanged = TRUE;
|
||||
@ -497,7 +499,7 @@ apply_rules_going_right (WEdit * edit, off_t i, edit_syntax_rule_t rule)
|
||||
}
|
||||
|
||||
/* check again to turn on a keyword if the context switched */
|
||||
if (contextchanged && !_rule.keyword)
|
||||
if (contextchanged && _rule.keyword == 0)
|
||||
{
|
||||
const char *p;
|
||||
|
||||
@ -523,12 +525,12 @@ apply_rules_going_right (WEdit * edit, off_t i, edit_syntax_rule_t rule)
|
||||
}
|
||||
}
|
||||
|
||||
return _rule;
|
||||
edit->rule = _rule;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static edit_syntax_rule_t
|
||||
static void
|
||||
edit_get_rule (WEdit * edit, off_t byte_index)
|
||||
{
|
||||
off_t i;
|
||||
@ -539,7 +541,7 @@ edit_get_rule (WEdit * edit, off_t byte_index)
|
||||
{
|
||||
off_t d = SYNTAX_MARKER_DENSITY;
|
||||
|
||||
edit->rule = apply_rules_going_right (edit, i, edit->rule);
|
||||
apply_rules_going_right (edit, i);
|
||||
|
||||
if (edit->syntax_marker != NULL)
|
||||
d += ((syntax_marker_t *) edit->syntax_marker->data)->offset;
|
||||
@ -565,7 +567,7 @@ edit_get_rule (WEdit * edit, off_t byte_index)
|
||||
{
|
||||
memset (&edit->rule, 0, sizeof (edit->rule));
|
||||
for (i = -1; i <= byte_index; i++)
|
||||
edit->rule = apply_rules_going_right (edit, i, edit->rule);
|
||||
apply_rules_going_right (edit, i);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -575,7 +577,7 @@ edit_get_rule (WEdit * edit, off_t byte_index)
|
||||
{
|
||||
edit->rule = s->rule;
|
||||
for (i = s->offset + 1; i <= byte_index; i++)
|
||||
edit->rule = apply_rules_going_right (edit, i, edit->rule);
|
||||
apply_rules_going_right (edit, i);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -584,15 +586,14 @@ edit_get_rule (WEdit * edit, off_t byte_index)
|
||||
}
|
||||
}
|
||||
edit->last_get_rule = byte_index;
|
||||
return edit->rule;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline int
|
||||
translate_rule_to_color (const WEdit * edit, edit_syntax_rule_t rule)
|
||||
translate_rule_to_color (const WEdit * edit, const edit_syntax_rule_t * rule)
|
||||
{
|
||||
return edit->rules[rule.context]->keyword[rule.keyword]->color;
|
||||
return edit->rules[rule->context]->keyword[rule->keyword]->color;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
@ -1259,7 +1260,7 @@ edit_read_syntax_file (WEdit * edit, char ***pnames, const char *syntax_file,
|
||||
if (args[0] == NULL)
|
||||
continue;
|
||||
|
||||
/* Looking for `include ...` lines before first `file ...` ones */
|
||||
/* Looking for 'include ...' lines before first 'file ...' ones */
|
||||
if (!found && strcmp (args[0], "include") == 0)
|
||||
{
|
||||
if (g != NULL)
|
||||
@ -1273,7 +1274,7 @@ edit_read_syntax_file (WEdit * edit, char ***pnames, const char *syntax_file,
|
||||
goto found_type;
|
||||
}
|
||||
|
||||
/* looking for `file ...' lines only */
|
||||
/* looking for 'file ...' lines only */
|
||||
if (strcmp (args[0], "file") != 0)
|
||||
continue;
|
||||
|
||||
@ -1398,7 +1399,10 @@ edit_get_syntax_color (WEdit * edit, off_t byte_index)
|
||||
return 0;
|
||||
|
||||
if (edit->rules != NULL && byte_index < edit->last_byte && option_syntax_highlighting)
|
||||
return translate_rule_to_color (edit, edit_get_rule (edit, byte_index));
|
||||
{
|
||||
edit_get_rule (edit, byte_index);
|
||||
return translate_rule_to_color (edit, &edit->rule);
|
||||
}
|
||||
|
||||
return EDITOR_NORMAL_COLOR;
|
||||
}
|
||||
@ -1484,15 +1488,9 @@ edit_load_syntax (WEdit * edit, char ***pnames, const char *type)
|
||||
|
||||
f = mc_config_get_full_path (EDIT_SYNTAX_FILE);
|
||||
if (edit != NULL)
|
||||
{
|
||||
char *tmp_f;
|
||||
|
||||
tmp_f = vfs_path_to_str (edit->filename_vpath);
|
||||
r = edit_read_syntax_file (edit, pnames, f, tmp_f,
|
||||
r = edit_read_syntax_file (edit, pnames, f, vfs_path_as_str (edit->filename_vpath),
|
||||
get_first_editor_line (edit),
|
||||
option_auto_syntax ? NULL : edit->syntax_type);
|
||||
g_free (tmp_f);
|
||||
}
|
||||
else
|
||||
r = edit_read_syntax_file (NULL, pnames, f, NULL, "", NULL);
|
||||
if (r == -1)
|
||||
|
@ -96,7 +96,7 @@ bad_line_start (WEdit * edit, off_t p)
|
||||
int c;
|
||||
c = edit_get_byte (edit, p);
|
||||
if (c == '.')
|
||||
{ /* `...' is acceptable */
|
||||
{ /* '...' is acceptable */
|
||||
if (edit_get_byte (edit, p + 1) == '.')
|
||||
if (edit_get_byte (edit, p + 2) == '.')
|
||||
return 0;
|
||||
@ -106,7 +106,7 @@ bad_line_start (WEdit * edit, off_t p)
|
||||
{
|
||||
if (edit_get_byte (edit, p + 1) == '-')
|
||||
if (edit_get_byte (edit, p + 2) == '-')
|
||||
return 0; /* `---' is acceptable */
|
||||
return 0; /* '---' is acceptable */
|
||||
return 1;
|
||||
}
|
||||
if (strchr (NO_FORMAT_CHARS_START, c))
|
||||
|
@ -1,9 +1,12 @@
|
||||
/*
|
||||
Execution routines for GNU Midnight Commander
|
||||
|
||||
Copyright (C) 2003, 2004, 2005, 2007, 2011
|
||||
Copyright (C) 2003, 2004, 2005, 2007, 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
Slava Zanko <slavazanko@gmail.com>, 2013
|
||||
|
||||
This file is part of the Midnight Commander.
|
||||
|
||||
The Midnight Commander is free software: you can redistribute it
|
||||
@ -187,11 +190,8 @@ execute_prepare_with_vfs_arg (const vfs_path_t * filename_vpath, vfs_path_t ** l
|
||||
*localcopy_vpath = mc_getlocalcopy (filename_vpath);
|
||||
if (*localcopy_vpath == NULL)
|
||||
{
|
||||
char *filename;
|
||||
|
||||
filename = vfs_path_to_str (filename_vpath);
|
||||
message (D_ERROR, MSG_ERROR, _("Cannot fetch a local copy of %s"), filename);
|
||||
g_free (filename);
|
||||
message (D_ERROR, MSG_ERROR, _("Cannot fetch a local copy of %s"),
|
||||
vfs_path_as_str (filename_vpath));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -484,7 +484,7 @@ toggle_panels (void)
|
||||
{
|
||||
if (output_starts_shell)
|
||||
{
|
||||
fprintf (stderr, _("Type `exit' to return to the Midnight Commander"));
|
||||
fprintf (stderr, _("Type 'exit' to return to the Midnight Commander"));
|
||||
fprintf (stderr, "\n\r\n\r");
|
||||
|
||||
my_system (EXECUTE_INTERNAL, mc_global.tty.shell, NULL);
|
||||
@ -505,7 +505,7 @@ toggle_panels (void)
|
||||
subshell */
|
||||
if ((quit & SUBSHELL_EXIT) != 0)
|
||||
{
|
||||
/* User did `exit' or `logout': quit MC */
|
||||
/* User did 'exit' or 'logout': quit MC */
|
||||
if (quiet_quit_cmd ())
|
||||
return;
|
||||
|
||||
|
@ -943,7 +943,11 @@ tree_box (const char *current_dir)
|
||||
WIDGET (bar)->y = LINES - 1;
|
||||
|
||||
if (run_dlg (dlg) == B_ENTER)
|
||||
val = vfs_path_to_str (tree_selected_name (mytree));
|
||||
{
|
||||
const vfs_path_t *selected_name;
|
||||
selected_name = tree_selected_name (mytree);
|
||||
val = g_strdup (vfs_path_as_str (selected_name));
|
||||
}
|
||||
|
||||
destroy_dlg (dlg);
|
||||
return val;
|
||||
@ -1066,41 +1070,30 @@ void
|
||||
symlink_dialog (const vfs_path_t * existing_vpath, const vfs_path_t * new_vpath,
|
||||
char **ret_existing, char **ret_new)
|
||||
{
|
||||
char *existing;
|
||||
char *new;
|
||||
|
||||
existing = vfs_path_to_str (existing_vpath);
|
||||
new = vfs_path_to_str (new_vpath);
|
||||
|
||||
{
|
||||
quick_widget_t quick_widgets[] = {
|
||||
quick_widget_t quick_widgets[] = {
|
||||
/* *INDENT-OFF* */
|
||||
QUICK_LABELED_INPUT (N_("Existing filename (filename symlink will point to):"),
|
||||
input_label_above,
|
||||
existing, "input-2", ret_existing, NULL, FALSE, FALSE, INPUT_COMPLETE_FILENAMES),
|
||||
vfs_path_as_str (existing_vpath), "input-2", ret_existing, NULL, FALSE, FALSE, INPUT_COMPLETE_FILENAMES),
|
||||
QUICK_SEPARATOR (FALSE),
|
||||
QUICK_LABELED_INPUT (N_("Symbolic link filename:"), input_label_above,
|
||||
new, "input-1", ret_new, NULL, FALSE, FALSE, INPUT_COMPLETE_FILENAMES),
|
||||
vfs_path_as_str (new_vpath), "input-1", ret_new, NULL, FALSE, FALSE, INPUT_COMPLETE_FILENAMES),
|
||||
QUICK_BUTTONS_OK_CANCEL,
|
||||
QUICK_END
|
||||
/* *INDENT-ON* */
|
||||
};
|
||||
};
|
||||
|
||||
quick_dialog_t qdlg = {
|
||||
-1, -1, 64,
|
||||
N_("Symbolic link"), "[File Menu]",
|
||||
quick_widgets, NULL, NULL
|
||||
};
|
||||
quick_dialog_t qdlg = {
|
||||
-1, -1, 64,
|
||||
N_("Symbolic link"), "[File Menu]",
|
||||
quick_widgets, NULL, NULL
|
||||
};
|
||||
|
||||
if (quick_dialog (&qdlg) == B_CANCEL)
|
||||
{
|
||||
*ret_new = NULL;
|
||||
*ret_existing = NULL;
|
||||
}
|
||||
if (quick_dialog (&qdlg) == B_CANCEL)
|
||||
{
|
||||
*ret_new = NULL;
|
||||
*ret_existing = NULL;
|
||||
}
|
||||
|
||||
g_free (existing);
|
||||
g_free (new);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -295,20 +295,15 @@ static int
|
||||
compare_files (const vfs_path_t * vpath1, const vfs_path_t * vpath2, off_t size)
|
||||
{
|
||||
int file1, file2;
|
||||
char *name;
|
||||
int result = -1; /* Different by default */
|
||||
|
||||
if (size == 0)
|
||||
return 0;
|
||||
|
||||
name = vfs_path_to_str (vpath1);
|
||||
file1 = open (name, O_RDONLY);
|
||||
g_free (name);
|
||||
file1 = open (vfs_path_as_str (vpath1), O_RDONLY);
|
||||
if (file1 >= 0)
|
||||
{
|
||||
name = vfs_path_to_str (vpath2);
|
||||
file2 = open (name, O_RDONLY);
|
||||
g_free (name);
|
||||
file2 = open (vfs_path_as_str (vpath2), O_RDONLY);
|
||||
if (file2 >= 0)
|
||||
{
|
||||
#ifdef HAVE_MMAP
|
||||
@ -1235,12 +1230,10 @@ hotlist_cmd (void)
|
||||
else
|
||||
{
|
||||
vfs_path_t *deprecated_vpath;
|
||||
char *cmd, *normalized_target;
|
||||
char *cmd;
|
||||
|
||||
deprecated_vpath = vfs_path_from_str_flags (target, VPF_USE_DEPRECATED_PARSER);
|
||||
normalized_target = vfs_path_to_str (deprecated_vpath);
|
||||
cmd = g_strconcat ("cd ", normalized_target, (char *) NULL);
|
||||
g_free (normalized_target);
|
||||
cmd = g_strconcat ("cd ", vfs_path_as_str (deprecated_vpath), (char *) NULL);
|
||||
vfs_path_free (deprecated_vpath);
|
||||
|
||||
do_cd_command (cmd);
|
||||
@ -1378,7 +1371,7 @@ edit_symlink_cmd (void)
|
||||
p = selection (current_panel)->fname;
|
||||
p_vpath = vfs_path_from_str (p);
|
||||
|
||||
q = g_strdup_printf (_("Symlink `%s\' points to:"), str_trunc (p, 32));
|
||||
q = g_strdup_printf (_("Symlink '%s\' points to:"), str_trunc (p, 32));
|
||||
|
||||
i = readlink (p, buffer, MC_MAXPATHLEN - 1);
|
||||
if (i > 0)
|
||||
@ -1418,7 +1411,7 @@ edit_symlink_cmd (void)
|
||||
}
|
||||
else
|
||||
{
|
||||
message (D_ERROR, MSG_ERROR, _("`%s' is not a symbolic link"),
|
||||
message (D_ERROR, MSG_ERROR, _("'%s' is not a symbolic link"),
|
||||
selection (current_panel)->fname);
|
||||
}
|
||||
}
|
||||
|
@ -5,9 +5,12 @@
|
||||
help from the program's callback.
|
||||
|
||||
Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
||||
2007, 2011
|
||||
2007, 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
Slava Zanko <slavazanko@gmail.com>, 2013
|
||||
|
||||
This file is part of the Midnight Commander.
|
||||
|
||||
The Midnight Commander is free software: you can redistribute it
|
||||
@ -399,8 +402,6 @@ do_cd_command (char *orig_cmd)
|
||||
}
|
||||
else if (strcmp (cmd + operand_pos, "..") == 0)
|
||||
{
|
||||
char *str_path;
|
||||
|
||||
if (vfs_path_elements_count (current_panel->cwd_vpath) != 1 ||
|
||||
strlen (vfs_path_get_by_index (current_panel->cwd_vpath, 0)->path) > 1)
|
||||
{
|
||||
@ -410,9 +411,7 @@ do_cd_command (char *orig_cmd)
|
||||
vfs_path_vtokens_get (tmp_vpath, 0, vfs_path_tokens_count (tmp_vpath) - 1);
|
||||
vfs_path_free (tmp_vpath);
|
||||
}
|
||||
str_path = vfs_path_to_str (current_panel->cwd_vpath);
|
||||
sync_tree (str_path);
|
||||
g_free (str_path);
|
||||
sync_tree (vfs_path_as_str (current_panel->cwd_vpath));
|
||||
}
|
||||
else if (cmd[operand_pos] == PATH_SEP)
|
||||
{
|
||||
@ -420,14 +419,11 @@ do_cd_command (char *orig_cmd)
|
||||
}
|
||||
else
|
||||
{
|
||||
char *str_path;
|
||||
vfs_path_t *new_vpath;
|
||||
|
||||
new_vpath = vfs_path_append_new (current_panel->cwd_vpath, cmd + operand_pos, NULL);
|
||||
str_path = vfs_path_to_str (new_vpath);
|
||||
sync_tree (vfs_path_as_str (new_vpath));
|
||||
vfs_path_free (new_vpath);
|
||||
sync_tree (str_path);
|
||||
g_free (str_path);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2,9 +2,12 @@
|
||||
Directory routines
|
||||
|
||||
Copyright (C) 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
||||
2006, 2007, 2011
|
||||
2006, 2007, 2011, 2013
|
||||
The Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
Slava Zanko <slavazanko@gmail.com>, 2013
|
||||
|
||||
This file is part of the Midnight Commander.
|
||||
|
||||
The Midnight Commander is free software: you can redistribute it
|
||||
@ -554,7 +557,7 @@ do_load_dir (const vfs_path_t * vpath, dir_list * list, sortfn * sort, gboolean
|
||||
int status, link_to_dir, stale_link;
|
||||
int next_free = 0;
|
||||
struct stat st;
|
||||
char *path;
|
||||
const char *vpath_str;
|
||||
|
||||
/* ".." (if any) must be the first entry in the list */
|
||||
if (!set_zero_dir (list))
|
||||
@ -573,11 +576,10 @@ do_load_dir (const vfs_path_t * vpath, dir_list * list, sortfn * sort, gboolean
|
||||
|
||||
tree_store_start_check (vpath);
|
||||
|
||||
vpath_str = vfs_path_as_str (vpath);
|
||||
/* Do not add a ".." entry to the root directory */
|
||||
path = vfs_path_to_str (vpath);
|
||||
if ((path[0] == PATH_SEP) && (path[1] == '\0'))
|
||||
if ((vpath_str[0] == PATH_SEP) && (vpath_str[1] == '\0'))
|
||||
next_free--;
|
||||
g_free (path);
|
||||
|
||||
while ((dp = mc_readdir (dirp)) != NULL)
|
||||
{
|
||||
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
x
Ссылка в новой задаче
Block a user