1
1

Merge branch '147_escaping' of ssh://www.midnight-commander.org:2222/git/mc into 147_escaping

* '147_escaping' of ssh://www.midnight-commander.org:2222/git/mc: (38 commits)
  Fixed bug with renamig/copying files with backshashes in names
  Remove some testing stuff
  Temporarry commit. Fixed completion in browse by directoryes.
  Fixed some memory leaks.
  Add $ and ` for escaping and reorder it according to the ascii values
  Rewrite it to use g_string_append_c instead of some homebrew stuff
  Fix escaping functions to also escape the leading whitespace
  Original patch as attached on the bugreport
  Add $ and ` for escaping and reorder it according to the ascii values
  Rewrite it to use g_string_append_c instead of some homebrew stuff
  Fix escaping functions to also escape the leading whitespace
  Original patch as attached on the bugreport
  Some minor fixes to the german locale
  Unfuzzied one more german string
  Some more fuzzy translations reviewed
  Reedited de.po with poedit.. Added some more translations and restructured the rest
  Add changelog entry about this change, as everything we do should be documented there
  Add some minor fixes concerning spelling issues
  ...
  po/de.po: some minor changes
  ...
Этот коммит содержится в:
Slava Zanko 2009-01-27 10:15:09 +02:00
родитель 2cd08d0d84 e58df8d75d
Коммит dbbd127e44
6 изменённых файлов: 308 добавлений и 167 удалений

Просмотреть файл

@ -4,6 +4,11 @@
* src/main.c, src/panel.h, src/screen.c, src/setup.c: * src/main.c, src/panel.h, src/screen.c, src/setup.c:
- Add support for showing executables at first in the panel view - Add support for showing executables at first in the panel view
2009-01-25 Patrick Winnertz <winnie@debian.org> & Sergei Trofimovich <slyfox@inbox.ru>
* mhl/string.h, vfs/fish.c, vfs/utilvfs.c, vfs/utilvfs.h: Reworked fish code
so that symlinks and files which special characters works now
2009-01-25 Enrico Weigelt <weigelt@metux.de> 2009-01-25 Enrico Weigelt <weigelt@metux.de>
* edit/editcmd.c, src/cmd.c, src/ext.c, src/history.h: * edit/editcmd.c, src/cmd.c, src/ext.c, src/history.h:
@ -50,6 +55,17 @@
* AUTHORS: Added Enrico Weigelt, Slava Zanko and * AUTHORS: Added Enrico Weigelt, Slava Zanko and
Patrick Winnertz as authors Patrick Winnertz as authors
2009-01-11 Patrick Winnertz <winnie@debian.org>
* po/de.po: Fix some spelling errors
2009-01-11 Enrico Weigelt, metux ITS <weigelt@metux.de>
* FAQ HACKING README man/*: new HQ url
* syntax/awk.syntax: added awk syntax file
* configure.ac: replaced obsolete autoconf macros AC_GNU_SOURCE
AC_AIX AC_MINIX by AC_USE_SYSTEM_EXTENSIONS
2009-01-11 Patrick Winnertz <winnie@debian.org> 2009-01-11 Patrick Winnertz <winnie@debian.org>
* syntax/pascal.syntax: Added syntax highlighting for * syntax/pascal.syntax: Added syntax highlighting for

Просмотреть файл

@ -9,6 +9,11 @@
#define mhl_str_ndup(str,len) ((str ? strndup(str,len) : strdup(""))) #define mhl_str_ndup(str,len) ((str ? strndup(str,len) : strdup("")))
#define mhl_str_len(str) ((str ? strlen(str) : 0)) #define mhl_str_len(str) ((str ? strlen(str) : 0))
static inline char * mhl_str_dup_range(const char * s_start, const char * s_bound)
{
return mhl_str_ndup(s_start, s_bound - s_start);
}
static inline char* mhl_str_trim(char* str) static inline char* mhl_str_trim(char* str)
{ {
if (!str) return NULL; // NULL string ?! bail out. if (!str) return NULL; // NULL string ?! bail out.
@ -121,4 +126,4 @@ static inline char* mhl_str_reverse(char* ptr)
return ptr; return ptr;
} }
#endif #endif /* __MHL_STRING_H */

158
po/de.po
Просмотреть файл

@ -13,9 +13,10 @@ msgstr ""
"Project-Id-Version: mc 4.6.x\n" "Project-Id-Version: mc 4.6.x\n"
"Report-Msgid-Bugs-To: mc-devel@gnome.org\n" "Report-Msgid-Bugs-To: mc-devel@gnome.org\n"
"POT-Creation-Date: 2009-01-06 13:46+0200\n" "POT-Creation-Date: 2009-01-06 13:46+0200\n"
"PO-Revision-Date: 2005-05-19 12:57+0100\n" "PO-Revision-Date: 2009-01-25 17:50-0000\n"
"Last-Translator: Roland Illig <roland.illig@gmx.de>\n" "Last-Translator: Patrick Winnertz <winnie@der-winnie.de>\n"
"Language-Team: German <gnome-de@gnome.org>\n" "Language-Team: German <gnome-de@gnome.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
@ -65,8 +66,9 @@ msgstr " Dateiname eingeben: "
msgid "Warning" msgid "Warning"
msgstr "Warnung" msgstr "Warnung"
#, fuzzy
msgid " File has hard-links. Detach before saving? " msgid " File has hard-links. Detach before saving? "
msgstr "" msgstr "Die Datei ist statisch verlinkt, sollen diese Links entfernt werden?"
msgid "&Yes" msgid "&Yes"
msgstr "&Ja" msgstr "&Ja"
@ -78,7 +80,7 @@ msgid "&Cancel"
msgstr "&Abbrechen" msgstr "&Abbrechen"
msgid "The file has been modified in the meantime. Save anyway?" msgid "The file has been modified in the meantime. Save anyway?"
msgstr "" msgstr "Die Datei wurde zwischenzeitlich modifiziert, trotzdem speichern?"
msgid " Error writing to pipe: " msgid " Error writing to pipe: "
msgstr " Fehler beim Schreiben auf Pipe: " msgstr " Fehler beim Schreiben auf Pipe: "
@ -166,8 +168,7 @@ msgid " Load "
msgstr "Laden" msgstr "Laden"
msgid " Block is large, you may not be able to undo this action. " msgid " Block is large, you may not be able to undo this action. "
msgstr "" msgstr " Gro▀er Block, eventuell kann diese Aktion nicht r№ckgфngig gemacht werden. "
" Gro▀er Block, eventuell kann diese Aktion nicht r№ckgфngig gemacht werden. "
msgid "O&ne" msgid "O&ne"
msgstr "ei&Ne" msgstr "ei&Ne"
@ -223,11 +224,8 @@ msgstr " Ersetzen "
msgid "Search" msgid "Search"
msgstr "Suchen" msgstr "Suchen"
msgid "" msgid " Invalid regular expression, or scanf expression with too many conversions "
" Invalid regular expression, or scanf expression with too many conversions " msgstr " Ung№ltiger regulфrer Ausdruck oder scanf-Ausdruck mit zu vielen Konvertierungen "
msgstr ""
" Ung№ltiger regulфrer Ausdruck oder scanf-Ausdruck mit zu vielen "
"Konvertierungen "
msgid " Error in replacement format string. " msgid " Error in replacement format string. "
msgstr " Fehler in der Format-Zeichenkette der Ersetzungen " msgstr " Fehler in der Format-Zeichenkette der Ersetzungen "
@ -792,7 +790,7 @@ msgstr "Sortierung"
#, fuzzy #, fuzzy
msgid " confirm di&Rectory hotlist delete " msgid " confirm di&Rectory hotlist delete "
msgstr "Ve&Rzeichnis-Hotlist C-\\" msgstr "Ve&Rzeichnis Hotlist lЎschen"
msgid " confirm &Exit " msgid " confirm &Exit "
msgstr " bestфtige &Beenden " msgstr " bestфtige &Beenden "
@ -945,10 +943,10 @@ msgid "sticky bit"
msgstr "Sticky Bit" msgstr "Sticky Bit"
msgid "set group ID on execution" msgid "set group ID on execution"
msgstr "Set Group ID bei Ausf№hrung" msgstr "Setze Gruppen-ID bei Ausf№hrung"
msgid "set user ID on execution" msgid "set user ID on execution"
msgstr "Set User ID bei Ausf№hrung" msgstr "Setze Nutzer-ID bei Ausf№hrung"
msgid "C&lear marked" msgid "C&lear marked"
msgstr "Markierte &aufheben" msgstr "Markierte &aufheben"
@ -966,10 +964,10 @@ msgid "Permissions (Octal)"
msgstr "Zugriffsrechte (oktal)" msgstr "Zugriffsrechte (oktal)"
msgid "Owner name" msgid "Owner name"
msgstr "Name des owners" msgstr "Owner-Name"
msgid "Group name" msgid "Group name"
msgstr "Name der group" msgstr "Gruppen-Name"
msgid "Use SPACE to change" msgid "Use SPACE to change"
msgstr "Zum ─ndern Leertaste dr№cken" msgstr "Zum ─ndern Leertaste dr№cken"
@ -993,31 +991,31 @@ msgid "Set &users"
msgstr "&User setzen" msgstr "&User setzen"
msgid "Set &groups" msgid "Set &groups"
msgstr "&Group setzen" msgstr "&Gruppe setzen"
msgid " Name " msgid " Name "
msgstr " Name " msgstr " Name "
msgid " Owner name " msgid " Owner name "
msgstr " Name des Owners " msgstr " Owner-Name "
msgid " Group name " msgid " Group name "
msgstr " Name der Group " msgstr " Gruppen-Name "
msgid " Size " msgid " Size "
msgstr " GrЎ▀e " msgstr " GrЎ▀e "
msgid " User name " msgid " User name "
msgstr " Name des Users" msgstr " Nutzername "
msgid " Chown command " msgid " Chown command "
msgstr " Chown Befehl " msgstr " Chown Befehl "
msgid "<Unknown user>" msgid "<Unknown user>"
msgstr "<unbekannter user>" msgstr "<unbekannter Nutzer>"
msgid "<Unknown group>" msgid "<Unknown group>"
msgstr "<unbekannte group>" msgstr "<unbekannte Gruppe>"
msgid "Files tagged, want to cd?" msgid "Files tagged, want to cd?"
msgstr "Dateien markiert, Verzeichnis wechseln?" msgstr "Dateien markiert, Verzeichnis wechseln?"
@ -1065,7 +1063,7 @@ msgid " Which extension file you want to edit? "
msgstr " Welcher Erweiterungsdatei mЎchten Sie bearbeiten? " msgstr " Welcher Erweiterungsdatei mЎchten Sie bearbeiten? "
msgid "&User" msgid "&User"
msgstr "ben&Utzer" msgstr "Ben&Utzer"
msgid "&System Wide" msgid "&System Wide"
msgstr "&Systemweit" msgstr "&Systemweit"
@ -1144,7 +1142,7 @@ msgstr " symbolischen Link bearbeiten, kann %s nicht entfernen: %s"
#, c-format #, c-format
msgid " edit symlink: %s " msgid " edit symlink: %s "
msgstr " symbolschen Link barbeiten: %s" msgstr " symbolschen Link bearbeiten: %s"
#, c-format #, c-format
msgid "`%s' is not a symbolic link" msgid "`%s' is not a symbolic link"
@ -1161,13 +1159,13 @@ msgid " Link to a remote machine "
msgstr " Link auf eine entfernte Maschine" msgstr " Link auf eine entfernte Maschine"
msgid " FTP to machine " msgid " FTP to machine "
msgstr " FTP zu Maschine " msgstr " FTP zu Server "
msgid " Shell link to machine " msgid " Shell link to machine "
msgstr " Shell-Verbindung zu Maschine " msgstr " Shell-Verbindung zu Server "
msgid " SMB link to machine " msgid " SMB link to machine "
msgstr "SMB-Verbindung zu Maschine " msgstr "SMB-Verbindung zu Server "
msgid " Undelete files on an ext2 file system " msgid " Undelete files on an ext2 file system "
msgstr " LЎschen von Dateien auf einem ext2 Dateisystem r№ckgфngig machen " msgstr " LЎschen von Dateien auf einem ext2 Dateisystem r№ckgфngig machen "
@ -1244,7 +1242,7 @@ msgid ""
" Cannot create temporary command file \n" " Cannot create temporary command file \n"
" %s " " %s "
msgstr "" msgstr ""
" Kann temporфre Befehlsdaei nicht anlegen \n" " Kann temporфre Befehlsdatei nicht anlegen \n"
" %s " " %s "
msgid " Parameter " msgid " Parameter "
@ -1255,10 +1253,7 @@ msgid " %s%s file error"
msgstr " Fehler in der Datei %s%s " msgstr " Fehler in der Datei %s%s "
#, c-format #, c-format
msgid "" msgid "The format of the %smc.ext file has changed with version 3.0. It seems that the installation failed. Please fetch a fresh copy from the Midnight Commander package."
"The format of the %smc.ext file has changed with version 3.0. It seems that "
"the installation failed. Please fetch a fresh copy from the Midnight "
"Commander package."
msgstr "" msgstr ""
"Das Dateiformat der Datei ╗%smc.extл hat sich in Version 3.0 geфndert.\n" "Das Dateiformat der Datei ╗%smc.extл hat sich in Version 3.0 geфndert.\n"
"Bitte aktualisieren Sie die Datei." "Bitte aktualisieren Sie die Datei."
@ -1268,13 +1263,8 @@ msgid " ~/%s file error "
msgstr " Fehler in Datei ╗~/%sл " msgstr " Fehler in Datei ╗~/%sл "
#, c-format #, c-format
msgid "" msgid "The format of the ~/%s file has changed with version 3.0. You may either want to copy it from %smc.ext or use that file as an example of how to write it."
"The format of the ~/%s file has changed with version 3.0. You may either " msgstr "Das Dateiformat von ╗~/%sл hat sich mit Version 3.0 geфndert. Eine Beispieldatei im neuen Format ist %smc.ext."
"want to copy it from %smc.ext or use that file as an example of how to write "
"it."
msgstr ""
"Das Dateiformat von ╗~/%sл hat sich mit Version 3.0 geфndert. Eine "
"Beispieldatei im neuen Format ist %smc.ext."
msgid " Copy " msgid " Copy "
msgstr " Kopieren " msgstr " Kopieren "
@ -1304,8 +1294,7 @@ msgid ""
"\n" "\n"
" Option Stable Symlinks will be disabled " " Option Stable Symlinks will be disabled "
msgstr "" msgstr ""
" Kann keine stabilen symbolischen Links auf nicht-lokalen Dateisystemen " " Kann keine stabilen symbolischen Links auf nicht-lokalen Dateisystemen anlegen: \n"
"anlegen: \n"
"\n" "\n"
" Einstellung Stabile Symbolische Links wird deaktiviert " " Einstellung Stabile Symbolische Links wird deaktiviert "
@ -1330,7 +1319,7 @@ msgid ""
" Cannot stat source file \"%s\" \n" " Cannot stat source file \"%s\" \n"
" %s " " %s "
msgstr "" msgstr ""
" Kann Quelldaei \"%s\" nicht untersuchen \n" " Kann Quelldatei \"%s\" nicht untersuchen \n"
" %s " " %s "
#, c-format #, c-format
@ -1757,9 +1746,8 @@ msgstr "ansicht - F3"
msgid "&Edit - F4" msgid "&Edit - F4"
msgstr "b&Earbeiten -F4" msgstr "b&Earbeiten -F4"
#, fuzzy
msgid "&Find recursively" msgid "&Find recursively"
msgstr "&Unterverzeichnisse durchsuchen" msgstr "Rec&ursiv durchsuchen"
msgid "Start at:" msgid "Start at:"
msgstr "Anfangen bei:" msgstr "Anfangen bei:"
@ -1887,6 +1875,8 @@ msgid ""
"\n" "\n"
" Are you sure you want to remove this entry?" " Are you sure you want to remove this entry?"
msgstr "" msgstr ""
"\n"
" Diesen Eintrag wirklich lЎschen?"
msgid "" msgid ""
"\n" "\n"
@ -1903,10 +1893,9 @@ msgstr " Startgruppe "
msgid " Hotlist Load " msgid " Hotlist Load "
msgstr " Hotlist laden " msgstr " Hotlist laden "
#, fuzzy, c-format #, c-format
msgid "" msgid "MC was unable to write ~/%s file, your old hotlist entries were not deleted"
"MC was unable to write ~/%s file, your old hotlist entries were not deleted" msgstr "MC konnte ~/%s nicht schreiben, die alten Hotlist-Eintrфge wurden nicht gelЎscht"
msgstr " Datei, die alten Hotlist-Eintrфge wurden nicht gelЎscht"
#, c-format #, c-format
msgid "Midnight Commander %s" msgid "Midnight Commander %s"
@ -1925,7 +1914,7 @@ msgstr "Keine Knoten-Information"
#, c-format #, c-format
msgid "Free space: %s (%d%%) of %s" msgid "Free space: %s (%d%%) of %s"
msgstr "Freie Knoten: %s (%d%%) von %s" msgstr "Freier Platz: %s (%d%%) von %s"
msgid "No space information" msgid "No space information"
msgstr "Keine Information №ber Speicherplatz" msgstr "Keine Information №ber Speicherplatz"
@ -2069,7 +2058,7 @@ msgstr " Kann diese Taste nicht akzeptieren "
#, c-format #, c-format
msgid " You have entered \"%s\"" msgid " You have entered \"%s\""
msgstr " Sie haben \"%s\" einggeben" msgstr " Sie haben \"%s\" eingegeben"
#. TRANSLATORS: This label appears near learned keys. Keep it short. #. TRANSLATORS: This label appears near learned keys. Keep it short.
msgid "OK" msgid "OK"
@ -2093,14 +2082,10 @@ msgstr ""
"Alle Tasten arbeiten vern№nftig" "Alle Tasten arbeiten vern№nftig"
msgid "Press all the keys mentioned here. After you have done it, check" msgid "Press all the keys mentioned here. After you have done it, check"
msgstr "" msgstr "Dr№cken Sie alle angegebenen Tasten. Wenn Sie das getan haben, №berpr№fen Sie,"
"Dr№cken Sie alle angegebenen Tasten. Wenn Sie das getan haben, №berpr№fen "
"Sie,"
msgid "which keys are not marked with OK. Press space on the missing" msgid "which keys are not marked with OK. Press space on the missing"
msgstr "" msgstr "welche Tasten nicht mit OK markiert sind. Dr№cken Sie die Leertaste bei den Fehlenden"
"welche Tasten nicht mit OK markiert sind. Dr№cken Sie die Leertaste bei den "
"Fehlenden"
msgid "key, or click with the mouse to define it. Move around with Tab." msgid "key, or click with the mouse to define it. Move around with Tab."
msgstr "Tasten oder arbeiten Sie mit der Maus, um sie zu definieren. " msgstr "Tasten oder arbeiten Sie mit der Maus, um sie zu definieren. "
@ -2143,7 +2128,7 @@ msgid "FT&P link..."
msgstr "FT&P-Verbindung..." msgstr "FT&P-Verbindung..."
msgid "S&hell link..." msgid "S&hell link..."
msgstr "Shell-Verbindung..." msgstr "S&hell-Verbindung..."
msgid "SM&B link..." msgid "SM&B link..."
msgstr "SM&B-Verbindung..." msgstr "SM&B-Verbindung..."
@ -2358,8 +2343,7 @@ msgid ""
" Menus: menu, menuhot, menusel, menuhotsel\n" " Menus: menu, menuhot, menusel, menuhotsel\n"
" Editor: editnormal, editbold, editmarked\n" " Editor: editnormal, editbold, editmarked\n"
" Help: helpnormal, helpitalic, helpbold, helplink, helpslink\n" " Help: helpnormal, helpitalic, helpbold, helplink, helpslink\n"
" File types: directory, executable, link, stalelink, device, special, " " File types: directory, executable, link, stalelink, device, special, core\n"
"core\n"
"\n" "\n"
"Colors:\n" "Colors:\n"
" black, gray, red, brightred, green, brightgreen, brown,\n" " black, gray, red, brightred, green, brightgreen, brown,\n"
@ -2380,8 +2364,7 @@ msgstr ""
" Men№s: menu, menuhot, menusel, menuhotsel\n" " Men№s: menu, menuhot, menusel, menuhotsel\n"
" Editor: editnormal, editbold, editmarked\n" " Editor: editnormal, editbold, editmarked\n"
" Hilfe: helpnormal, helpitalic, helplink, helpslink\n" " Hilfe: helpnormal, helpitalic, helplink, helpslink\n"
" Dateitypen: directory, executable, link, stalelink, device, special, " " Dateitypen: directory, executable, link, stalelink, device, special, core\n"
"core\n"
"\n" "\n"
"Farben:\n" "Farben:\n"
" black, gray, red, brightred, green, brightgreen, brown,\n" " black, gray, red, brightred, green, brightgreen, brown,\n"
@ -2629,13 +2612,13 @@ msgstr "Eigent
msgid "Group" msgid "Group"
msgstr "Gruppe" msgstr "Gruppe"
#, fuzzy, c-format #, c-format
msgid "%s byte" msgid "%s byte"
msgid_plural "%s bytes" msgid_plural "%s bytes"
msgstr[0] "%s Bytes" msgstr[0] "%s Bytes"
msgstr[1] "%s Bytes" msgstr[1] "%s Bytes"
#, fuzzy, c-format #, c-format
msgid "%s in %d file" msgid "%s in %d file"
msgid_plural "%s in %d files" msgid_plural "%s in %d files"
msgstr[0] "%s Bytes in %d Datei" msgstr[0] "%s Bytes in %d Datei"
@ -2836,8 +2819,7 @@ msgid ""
"File %s is not owned by root or you or is world writable.\n" "File %s is not owned by root or you or is world writable.\n"
"Using it may compromise your security" "Using it may compromise your security"
msgstr "" msgstr ""
"Die Datei %s gehЎrt weder root noch Ihnen oder sie kann von jedem " "Die Datei %s gehЎrt weder root noch Ihnen oder sie kann von jedem beschrieben werden.\n"
"beschrieben werden.\n"
"Sie zu benutzen, kann Ihre Sicherheit gefфhrden" "Sie zu benutzen, kann Ihre Sicherheit gefфhrden"
#, c-format #, c-format
@ -2972,9 +2954,8 @@ msgstr ""
msgid " Goto Address " msgid " Goto Address "
msgstr " Gehe zu Adresse " msgstr " Gehe zu Adresse "
#, fuzzy
msgid " Invalid address " msgid " Invalid address "
msgstr " Ung№ltiges Pa▀wort " msgstr " Ung№ltige Adresse"
msgid " Enter regexp:" msgid " Enter regexp:"
msgstr " Regulфrer Ausdruck:" msgstr " Regulфrer Ausdruck:"
@ -3372,7 +3353,7 @@ msgstr "ftpfs: Verbindung durch Benutzer unterbrochen"
#, c-format #, c-format
msgid "ftpfs: connection to server failed: %s" msgid "ftpfs: connection to server failed: %s"
msgstr "ftpfs: Verbindung zum Server fehlgeschlgen: %s" msgstr "ftpfs: Verbindung zum Server fehlgeschlagen: %s"
#, c-format #, c-format
msgid "Waiting to retry... %d (Control-C to cancel)" msgid "Waiting to retry... %d (Control-C to cancel)"
@ -3613,44 +3594,3 @@ msgstr "Interner Fehler:"
msgid "Changes to file lost" msgid "Changes to file lost"
msgstr "─nderungen an Datei verlorengegangen" msgstr "─nderungen an Datei verlorengegangen"
#~ msgid "&Home"
#~ msgstr "&Home"
#~ msgid "&Type"
#~ msgstr "&Typ"
#~ msgid "&Links"
#~ msgstr "&Links"
#~ msgid "N&GID"
#~ msgstr "N&GID"
#~ msgid "N&UID"
#~ msgstr "N&UID"
#~ msgid "&Owner"
#~ msgstr "&Owner"
#~ msgid "&Group"
#~ msgstr "&Group"
#~ msgid "MC was unable to write ~/"
#~ msgstr "MC konnte nicht schreiben in ~/"
#~ msgid " (%ld blocks)"
#~ msgstr "(%ld BlЎcke)"
#~ msgid " Notice "
#~ msgstr " Anmerkung "
#~ msgid ""
#~ " The Midnight Commander configuration files \n"
#~ " are now stored in the ~/.mc directory, the \n"
#~ " files have been moved now\n"
#~ msgstr ""
#~ " Die Konfigurationsdateien des Midnight Commanders \n"
#~ " wurden im ~/.mc Verzeichnis gespeichert, die Dateien \n"
#~ " wurden jetzt verschoben\n"
#~ msgid "%s bytes in %d files"
#~ msgstr "%s Bytes in %d Dateien"

Просмотреть файл

@ -50,6 +50,9 @@
#include "tcputil.h" #include "tcputil.h"
#include "../src/unixcompat.h" #include "../src/unixcompat.h"
#include "fish.h" #include "fish.h"
#include "../mhl/memory.h"
#include "../mhl/string.h"
#include "../mhl/escape.h"
int fish_directory_timeout = 900; int fish_directory_timeout = 900;
@ -358,33 +361,100 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path)
char *quoted_path; char *quoted_path;
int reply_code; int reply_code;
#if 0
/*
* Simple FISH debug interface :]
*/
if (!(MEDATA->logfile))
{
MEDATA->logfile = fopen("/tmp/mc-FISH.sh", "w");
}
#endif // 0
logfile = MEDATA->logfile; logfile = MEDATA->logfile;
print_vfs_message(_("fish: Reading directory %s..."), remote_path); print_vfs_message(_("fish: Reading directory %s..."), remote_path);
gettimeofday(&dir->timestamp, NULL); gettimeofday(&dir->timestamp, NULL);
dir->timestamp.tv_sec += fish_directory_timeout; dir->timestamp.tv_sec += fish_directory_timeout;
quoted_path = name_quote (remote_path, 0); quoted_path = mhl_shell_escape_dup (remote_path);
fish_command (me, super, NONE, fish_command (me, super, NONE,
"#LIST /%s\n" "#LIST /%s\n"
"if ls -1 /%s >/dev/null 2>&1 ;\n" "if `perl -v > /dev/null 2>&1` ; then\n"
"then\n" "perl -e '\n"
"ls -lLan /%s 2>/dev/null | grep '^[^cbt]' | (\n" "use strict;\n"
"while read p l u g s m d y n; do\n" "use POSIX;\n"
"echo \"P$p $u.$g\nS$s\nd$m $d $y\n:$n\n\"\n" "use Fcntl;\n"
"done\n" "use POSIX \":fcntl_h\"; #S_ISLNK was here until 5.6\n"
")\n" "import Fcntl \":mode\" unless defined &S_ISLNK; #and is now here\n"
"ls -lan /%s 2>/dev/null | grep '^[cb]' | (\n" "my $dirname = $ARGV[0];\n"
"while read p l u g a i m d y n; do\n" "if (opendir ( DIR, $dirname )) {\n"
"echo \"P$p $u.$g\nE$a$i\nd$m $d $y\n:$n\n\"\n" "while( (my $filename = readdir(DIR))){\n"
"done\n" "my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = lstat(\"$dirname/$filename\");\n"
")\n" "my $mloctime= scalar localtime $mtime;\n"
"echo '### 200'\n" "my $shell_escape_regex= s/([;<>\\*\\|`&\\$!#\\(\\)\\[\\]\\{\\}:'\\''\"\\ \\\\])/\\\\$1/g;\n"
"else\n" "my $e_filename = $filename;\n"
"echo '### 500'\n" "$e_filename =~ $shell_escape_regex;\n"
"fi\n", "if (S_ISLNK($mode) ) {\n"
remote_path, quoted_path, quoted_path, quoted_path); "my $linkname = readlink (\"$dirname/$filename\");\n"
g_free (quoted_path); "$linkname =~ $shell_escape_regex;\n"
"\n"
"printf(\"R%%o %%o $uid.$gid\\n"
"S$size\\n"
"d$mloctime\\n"
":\\\"$e_filename\\\" -> \\\"$linkname\\\"\\n"
"\\n\", S_IMODE($mode), S_IFMT($mode));\n"
"} else {\n"
"printf(\"R%%o %%o $uid.$gid\\n"
"S$size\\n"
"d$mloctime\\n"
":\\\"$e_filename\\\"\\n"
"\\n\", S_IMODE($mode), S_IFMT($mode));\n"
"}}\n"
"printf(\"### 200\\n\");\n"
"closedir(DIR);\n"
"} else {\n"
"printf(\"### 500\\n\");\n"
"}\n"
"exit 0\n"
"' /%s ||\n" /* ARGV[0] - path to browse */
" echo '### 500'\n" /* do not hang if perl is to eval it */
"elif `ls -1 /%s >/dev/null 2>&1` ; then\n"
"if `ls -Q /%s >/dev/null 2>&1`; then\n"
"LSOPT=\"-Qlan\";\n"
"ADD=0;\n"
"else\n"
"LSOPT=\"-lan\";\n"
"ADD=1;\n"
"fi\n"
"ls $LSOPT \"/%s\" 2>/dev/null | grep '^[^cbt]' | (\n"
"while read p l u g s m d y n; do\n"
"if [ $ADD = 0 ]; then\n"
"echo \"P$p $u.$g\nS$s\nd$m $d $y\n:$n\n\"\n"
"elif `sed --version >/dev/null 2>&1` ; then\n"
"file=`echo $n | sed -e 's#^\\(.*\\) -> \\(.*\\)#\\1\" -> \"\\2#'`\n"
"echo \"P$p $u $g\nS$s\nd$m $d $y\n:\"$file\"\n\"\n"
"else\n"
"echo \"P$p $u $g\nS$s\nd$m $d $y\n:\"$n\"\n\"\n"
"fi\n"
"done )\n"
"ls $LSOPT /%s 2>/dev/null | grep '^[cb]' | (\n"
"while read p l u g a i m d y n; do\n"
"if [ $ADD = 0 ]; then\n"
"echo \"P$p $u.$g\nE$a$i\nd$m $d $y\n:$n\n\"\n"
"elif `sed --version >/dev/null 2>&1` ; then\n"
"file=`echo $n | sed -e 's#^\\(.*\\) -> \\(.*\\)#\\1\" -> \"\\2#'`\n"
"echo \"P$p $u $g\nS$s\nd$m $d $y\n:\"$file\"\n\"\n"
"else\n"
"echo \"P$p $u $g\nS$s\nd$m $d $y\n:\"$n\"\n\"\n"
"fi\n"
"done)\n"
"echo '### 200'\n"
"else\n"
"echo '### 500'\n"
"fi\n",
quoted_path, quoted_path, quoted_path, quoted_path, quoted_path, quoted_path);
mhl_mem_free (quoted_path);
ent = vfs_s_generate_entry(me, NULL, dir, 0); ent = vfs_s_generate_entry(me, NULL, dir, 0);
while (1) { while (1) {
int res = vfs_s_get_line_interruptible (me, buffer, sizeof (buffer), SUP.sockr); int res = vfs_s_get_line_interruptible (me, buffer, sizeof (buffer), SUP.sockr);
@ -412,11 +482,61 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path)
switch(buffer[0]) { switch(buffer[0]) {
case ':': { case ':': {
if (!strcmp(buffer+1, ".") || !strcmp(buffer+1, "..")) char *data_start = buffer+1;
break; /* We'll do . and .. ourself */ char *filename = data_start;
ent->name = g_strdup(buffer+1); char *linkname = data_start;
break; char *filename_bound = filename + strlen(filename);
} char *linkname_bound = filename_bound;
if (!strcmp(data_start, "\".\"") || !strcmp(data_start, "\"..\""))
break; /* We'll do "." and ".." ourselves */
if (S_ISLNK(ST.st_mode)) {
// we expect: "escaped-name" -> "escaped-name"
// -> cannot occur in filenames,
// because it will be escaped to -\>
if (*filename == '"')
++filename;
linkname = strstr(filename, "\" -> \"");
if (!linkname)
{
/* broken client, or smth goes wrong */
linkname = filename_bound;
if (filename_bound > filename
&& *(filename_bound - 1) == '"')
--filename_bound; // skip trailing "
}
else
{
filename_bound = linkname;
linkname += 6; // strlen ("\" -> \"")
if (*(linkname_bound - 1) == '"')
--linkname_bound; // skip trailing "
}
ent->name = mhl_str_dup_range(filename, filename_bound);
mhl_shell_unescape_buf(ent->name);
ent->ino->linkname = mhl_str_dup_range(linkname, linkname_bound);
mhl_shell_unescape_buf(ent->ino->linkname);
} else {
// we expect: "escaped-name"
if (filename_bound - filename > 2)
{
// there is at least 2 "
// and we skip them
if (*filename == '"')
++filename;
if (*(filename_bound - 1) == '"')
--filename_bound;
}
ent->name = mhl_str_dup_range(filename, filename_bound);
mhl_shell_unescape_buf(ent->name);
}
break;
}
case 'S': case 'S':
#ifdef HAVE_ATOLL #ifdef HAVE_ATOLL
ST.st_size = (off_t) atoll (buffer+1); ST.st_size = (off_t) atoll (buffer+1);
@ -426,11 +546,14 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path)
break; break;
case 'P': { case 'P': {
size_t skipped; size_t skipped;
vfs_parse_filemode (buffer + 1, &skipped, &ST.st_mode);
if (vfs_parse_filemode (buffer + 1, &skipped, &ST.st_mode)) { break;
if (S_ISLNK(ST.st_mode)) }
ST.st_mode = 0; case 'R': {
} // raw filemode:
// we expect: Roctal-filemode octal-filetype uid.gid
size_t skipped;
vfs_parse_raw_filemode (buffer + 1, &skipped, &ST.st_mode);
break; break;
} }
case 'd': { case 'd': {
@ -456,8 +579,6 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path)
ST.st_rdev = makedev (maj, min); ST.st_rdev = makedev (maj, min);
#endif #endif
} }
case 'L': ent->ino->linkname = g_strdup(buffer+1);
break;
} }
} }
@ -528,8 +649,8 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc
* algorithm for file appending case, therefore just "dd" is used for it. * algorithm for file appending case, therefore just "dd" is used for it.
*/ */
print_vfs_message(_("fish: store %s: sending command..."), name ); quoted_name = mhl_shell_escape_dup(name);
quoted_name = name_quote (name, 0); print_vfs_message(_("fish: store %s: sending command..."), quoted_name );
/* FIXME: File size is limited to ULONG_MAX */ /* FIXME: File size is limited to ULONG_MAX */
if (!fh->u.fish.append) if (!fh->u.fish.append)
@ -541,7 +662,7 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc
"(\n" "(\n"
"head -c %lu -q - || echo DD >&3\n" "head -c %lu -q - || echo DD >&3\n"
") 2>/dev/null | (\n" ") 2>/dev/null | (\n"
"cat > \"$file\"\n" "cat > $file\n"
"cat > /dev/null\n" "cat > /dev/null\n"
")`; [ \"$res\" = DD ] && {\n" ")`; [ \"$res\" = DD ] && {\n"
"> \"$file\"\n" "> \"$file\"\n"
@ -553,7 +674,7 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc
" rest=`expr $rest - $n`\n" " rest=`expr $rest - $n`\n"
"done\n" "done\n"
"}; echo '### 200'\n", "}; echo '### 200'\n",
(unsigned long) s.st_size, name, (unsigned long) s.st_size, quoted_name,
quoted_name, (unsigned long) s.st_size, quoted_name, (unsigned long) s.st_size,
(unsigned long) s.st_size); (unsigned long) s.st_size);
else else
@ -566,14 +687,13 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc
"while [ $rest -gt 0 ]\n" "while [ $rest -gt 0 ]\n"
"do\n" "do\n"
" cnt=`expr \\( $rest + 255 \\) / 256`\n" " cnt=`expr \\( $rest + 255 \\) / 256`\n"
" n=`dd bs=256 count=$cnt | tee -a \"$file\" | wc -c`\n" " n=`dd bs=256 count=$cnt | tee -a $file | wc -c`\n"
" rest=`expr $rest - $n`\n" " rest=`expr $rest - $n`\n"
"done\n" "done\n"
"}; echo '### 200'\n", "}; echo '### 200'\n",
(unsigned long) s.st_size, name, (unsigned long) s.st_size, quoted_name,
quoted_name, (unsigned long) s.st_size); quoted_name, (unsigned long) s.st_size);
g_free (quoted_name);
if (n != PRELIM) { if (n != PRELIM) {
close (h); close (h);
ERRNOR(E_REMOTE, -1); ERRNOR(E_REMOTE, -1);
@ -606,12 +726,14 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc
(unsigned long) s.st_size); (unsigned long) s.st_size);
} }
close(h); close(h);
mhl_mem_free(quoted_name);
if ((fish_get_reply (me, SUP.sockr, NULL, 0) != COMPLETE) || was_error) if ((fish_get_reply (me, SUP.sockr, NULL, 0) != COMPLETE) || was_error)
ERRNOR (E_REMOTE, -1); ERRNOR (E_REMOTE, -1);
return 0; return 0;
error_return: error_return:
close(h); close(h);
fish_get_reply(me, SUP.sockr, NULL, 0); fish_get_reply(me, SUP.sockr, NULL, 0);
mhl_mem_free(quoted_name);
return -1; return -1;
} }
@ -625,9 +747,7 @@ fish_linear_start (struct vfs_class *me, struct vfs_s_fh *fh, off_t offset)
name = vfs_s_fullpath (me, fh->ino); name = vfs_s_fullpath (me, fh->ino);
if (!name) if (!name)
return 0; return 0;
quoted_name = name_quote (name, 0); quoted_name = mhl_shell_escape_dup(name);
g_free (name);
name = quoted_name;
fh->u.fish.append = 0; fh->u.fish.append = 0;
/* /*
@ -642,16 +762,16 @@ fish_linear_start (struct vfs_class *me, struct vfs_s_fh *fh, off_t offset)
"then\n" "then\n"
"ls -ln /%s 2>/dev/null | (\n" "ls -ln /%s 2>/dev/null | (\n"
"read p l u g s r\n" "read p l u g s r\n"
"echo \"$s\"\n" "echo $s\n"
")\n" ")\n"
"echo '### 100'\n" "echo '### 100'\n"
"cat /%s\n" "cat /%s\n"
"echo '### 200'\n" "echo '### 200'\n"
"else\n" "else\n"
"echo '### 500'\n" "echo '### 500'\n"
"fi\n", "fi\n",
name, name, name, name ); quoted_name, quoted_name, quoted_name, quoted_name );
g_free (name); g_free (quoted_name);
if (offset != PRELIM) ERRNOR (E_REMOTE, 0); if (offset != PRELIM) ERRNOR (E_REMOTE, 0);
fh->linear = LS_LINEAR_OPEN; fh->linear = LS_LINEAR_OPEN;
fh->u.fish.got = 0; fh->u.fish.got = 0;
@ -766,7 +886,7 @@ fish_send_command(struct vfs_class *me, struct vfs_s_super *super, const char *c
g_free (mpath); \ g_free (mpath); \
return -1; \ return -1; \
} \ } \
rpath = name_quote (crpath, 0); \ rpath = mhl_shell_escape_dup(crpath); \
g_free (mpath); g_free (mpath);
#define POSTFIX(flags) \ #define POSTFIX(flags) \
@ -778,7 +898,7 @@ fish_chmod (struct vfs_class *me, const char *path, int mode)
{ {
PREFIX PREFIX
g_snprintf(buf, sizeof(buf), "#CHMOD %4.4o /%s\n" g_snprintf(buf, sizeof(buf), "#CHMOD %4.4o /%s\n"
"chmod %4.4o \"/%s\" 2>/dev/null\n" "chmod %4.4o /%s 2>/dev/null\n"
"echo '### 000'\n", "echo '### 000'\n",
mode & 07777, rpath, mode & 07777, rpath,
mode & 07777, rpath); mode & 07777, rpath);
@ -801,13 +921,13 @@ static int fish_##name (struct vfs_class *me, const char *path1, const char *pat
g_free (mpath2); \ g_free (mpath2); \
return -1; \ return -1; \
} \ } \
rpath1 = name_quote (crpath1, 0); \ rpath1 = mhl_shell_escape_dup (crpath1); \
g_free (mpath1); \ g_free (mpath1); \
rpath2 = name_quote (crpath2, 0); \ rpath2 = mhl_shell_escape_dup (crpath2); \
g_free (mpath2); \ g_free (mpath2); \
g_snprintf(buf, sizeof(buf), string "\n", rpath1, rpath2, rpath1, rpath2); \ g_snprintf(buf, sizeof(buf), string "\n", rpath1, rpath2, rpath1, rpath2); \
g_free (rpath1); \ mhl_mem_free (rpath1); \
g_free (rpath2); \ mhl_mem_free (rpath2); \
return fish_send_command(me, super2, buf, OPT_FLUSH); \ return fish_send_command(me, super2, buf, OPT_FLUSH); \
} }
@ -822,13 +942,13 @@ static int fish_symlink (struct vfs_class *me, const char *setto, const char *pa
{ {
char *qsetto; char *qsetto;
PREFIX PREFIX
qsetto = name_quote (setto, 0); qsetto = mhl_shell_escape_dup (setto);
g_snprintf(buf, sizeof(buf), g_snprintf(buf, sizeof(buf),
"#SYMLINK %s /%s\n" "#SYMLINK %s /%s\n"
"ln -s %s /%s 2>/dev/null\n" "ln -s %s /%s 2>/dev/null\n"
"echo '### 000'\n", "echo '### 000'\n",
qsetto, rpath, qsetto, rpath); qsetto, rpath, qsetto, rpath);
g_free (qsetto); mhl_mem_free (qsetto);
POSTFIX(OPT_FLUSH); POSTFIX(OPT_FLUSH);
} }
@ -850,7 +970,7 @@ fish_chown (struct vfs_class *me, const char *path, int owner, int group)
{ {
PREFIX PREFIX
g_snprintf (buf, sizeof(buf), g_snprintf (buf, sizeof(buf),
"#CHOWN /%s /%s\n" "#CHOWN %s /%s\n"
"chown %s /%s 2>/dev/null\n" "chown %s /%s 2>/dev/null\n"
"echo '### 000'\n", "echo '### 000'\n",
sowner, rpath, sowner, rpath,
@ -858,8 +978,8 @@ fish_chown (struct vfs_class *me, const char *path, int owner, int group)
fish_send_command (me, super, buf, OPT_FLUSH); fish_send_command (me, super, buf, OPT_FLUSH);
/* FIXME: what should we report if chgrp succeeds but chown fails? */ /* FIXME: what should we report if chgrp succeeds but chown fails? */
g_snprintf (buf, sizeof(buf), g_snprintf (buf, sizeof(buf),
"#CHGRP /%s /%s\n" "#CHGRP /%s \"/%s\"\n"
"chgrp %s /%s 2>/dev/null\n" "chgrp %s \"/%s\" 2>/dev/null\n"
"echo '### 000'\n", "echo '### 000'\n",
sgroup, rpath, sgroup, rpath,
sgroup, rpath); sgroup, rpath);

Просмотреть файл

@ -539,6 +539,64 @@ vfs_parse_filemode (const char *s, size_t *ret_skipped,
return TRUE; return TRUE;
} }
gboolean
vfs_parse_raw_filemode (const char *s, size_t *ret_skipped,
mode_t *ret_mode)
{
const char *p;
mode_t remote_type = 0, local_type, perms = 0;
p = s;
// isoctal
while(*p >= '0' && *p <= '7')
{
perms *= 010;
perms += (*p - '0');
++p;
}
if (*p++ != ' ')
return FALSE;
while(*p >= '0' && *p <= '7')
{
remote_type *= 010;
remote_type += (*p - '0');
++p;
}
if (*p++ != ' ')
return FALSE;
/* generated with:
$ perl -e 'use Fcntl ":mode";
my @modes = (S_IFDIR, S_IFBLK, S_IFCHR, S_IFLNK, S_IFREG);
foreach $t (@modes) { printf ("%o\n", $t); };'
TODO: S_IFDOOR, S_IFIFO, S_IFSOCK (if supported by os)
(see vfs_parse_filetype)
*/
switch (remote_type)
{
case 020000:
local_type = S_IFCHR; break;
case 040000:
local_type = S_IFDIR; break;
case 060000:
local_type = S_IFBLK; break;
case 0120000:
local_type = S_IFLNK; break;
case 0100000:
default:// don't know what is it
local_type = S_IFREG; break;
}
*ret_skipped = p - s;
*ret_mode = local_type | perms;
return TRUE;
}
/* This function parses from idx in the columns[] array */ /* This function parses from idx in the columns[] array */
int int
vfs_parse_filedate (int idx, time_t *t) vfs_parse_filedate (int idx, time_t *t)

Просмотреть файл

@ -24,6 +24,8 @@ gboolean vfs_parse_fileperms (const char *s, size_t *ret_skipped,
mode_t *ret_perms); mode_t *ret_perms);
gboolean vfs_parse_filemode (const char *s, size_t *ret_skipped, gboolean vfs_parse_filemode (const char *s, size_t *ret_skipped,
mode_t *ret_mode); mode_t *ret_mode);
gboolean vfs_parse_raw_filemode (const char *s, size_t *ret_skipped,
mode_t *ret_mode);
int vfs_parse_ls_lga (const char *p, struct stat *s, char **filename, int vfs_parse_ls_lga (const char *p, struct stat *s, char **filename,
char **linkname); char **linkname);