From 428e233f37519aeb2c8fc26bbeebad60322cd493 Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Tue, 10 Feb 2009 13:21:17 +0100 Subject: [PATCH 01/19] Revert "Resolve some issues in mhl Rollang Illig pointed us to:" This reverts commit 60f2d8d3c08e3dd7d53f5a5f14abc8ac1fed12de. --- mhl/env.h | 4 ++-- mhl/escape.h | 8 ++++---- mhl/memory.h | 6 +++--- mhl/strhash.h | 4 ++-- mhl/string.h | 22 +++++++++------------- mhl/types.h | 8 +++----- 6 files changed, 23 insertions(+), 29 deletions(-) diff --git a/mhl/env.h b/mhl/env.h index 6598e0cbf..8d5633797 100644 --- a/mhl/env.h +++ b/mhl/env.h @@ -1,5 +1,5 @@ -#ifndef MHL_ENV_H -#define MHL_ENV_H +#ifndef __MHL_ENV_H +#define __MHL_ENV_H #include diff --git a/mhl/escape.h b/mhl/escape.h index 485579c59..ed25b608a 100644 --- a/mhl/escape.h +++ b/mhl/escape.h @@ -1,5 +1,5 @@ -#ifndef MHL_ESCAPE_H -#define MHL_ESCAPE_H +#ifndef __MHL_SHELL_ESCAPE_H +#define __MHL_SHELL_ESCAPE_H /* Micro helper library: shell escaping functions */ @@ -63,7 +63,7 @@ static inline SHELL_ESCAPED_STR mhl_shell_escape_dup(const char* src) /** Unescape paths or other strings for e.g the internal cd shell-unescape within a given buffer (writing to it!) - /params const char * src + /params const char * in string for unescaping /returns return unescaped string @@ -112,7 +112,7 @@ static inline char* mhl_shell_unescape_buf(char* text) case '`': case '"': case ';': - case '\0': /* end of string! malformed escape string */ + case '\0': /* end of line! malformed escape string */ goto out; default: (*writeptr) = c; writeptr++; break; diff --git a/mhl/memory.h b/mhl/memory.h index 3268e93a1..b00617700 100644 --- a/mhl/memory.h +++ b/mhl/memory.h @@ -1,5 +1,5 @@ -#ifndef MHL_MEMORY_H -#define MHL_MEMORY_H +#ifndef __MHL_MEM +#define __MHL_MEM #include #include @@ -17,7 +17,7 @@ static inline void mhl_mem_free(void* ptr) } /* free an ptr and NULL it */ -#define MHL_PTR_FREE(ptr) do { mhl_mem_free(ptr); (ptr) = NULL; } while (0) +#define MHL_PTR_FREE(ptr) do { mhl_mem_free(ptr); (ptr) = NULL; } while (0); /* allocate a chunk on stack - automatically free'd on function exit */ #define mhl_stack_alloc(sz) (alloca(sz)) diff --git a/mhl/strhash.h b/mhl/strhash.h index 8ff17cba6..1f195053c 100644 --- a/mhl/strhash.h +++ b/mhl/strhash.h @@ -1,5 +1,5 @@ -#ifndef MHL_STRHASH_H -#define MHL_STRHASH_H +#ifndef __MHL_STRHASH_H +#define __MHL_STRHASH_H #include #include diff --git a/mhl/string.h b/mhl/string.h index 3b4c421f1..47f097f1e 100644 --- a/mhl/string.h +++ b/mhl/string.h @@ -1,5 +1,5 @@ -#ifndef MHL_STRING_H -#define MHL_STRING_H +#ifndef __MHL_STRING_H +#define __MHL_STRING_H #include #include @@ -10,9 +10,6 @@ #define mhl_str_ndup(str,len) ((str ? strndup(str,len) : strdup(""))) #define mhl_str_len(str) ((str ? strlen(str) : 0)) -#define ISSPACE(c) isspace((unsigned char)(c)) -#define TOUPPER(c) toupper((unsigned char)(c)) - 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); @@ -23,26 +20,26 @@ static inline char* mhl_str_trim(char* str) if (!str) return NULL; /* NULL string ?! bail out. */ /* find the first non-space */ - char* start; for (start=str; ((*str) && (!ISSPACE(*str))); str++); + char* start; for (start=str; ((*str) && (!isspace(*str))); str++); /* only spaces ? */ if (!(*str)) { *str = 0; return str; } - /* get the size (cannot be empty - caught above) */ + /* get the size (cannot be empty - catched above) */ size_t _sz = strlen(str); /* find the proper end */ char* end; - for (end=(str+_sz-1); ((end>str) && (ISSPACE(*end))); end--); + for (end=(str+_sz-1); ((end>str) && (isspace(*end))); end--); end[1] = 0; /* terminate, just to be sure */ /* if we have no leading spaces, just trucate */ if (start==str) { end++; *end = 0; return str; } - /* if it's only one char, dont need memmove for that */ + /* if it' only one char, dont need memmove for that */ if (start==end) { str[0]=*start; str[1]=0; return str; } - /* by here we have a (non-empty) region between start and end */ + /* by here we have a (non-empty) region between start end end */ memmove(str,start,(end-start+1)); return str; } @@ -51,7 +48,7 @@ static inline void mhl_str_toupper(char* str) { if (str) for (;*str;str++) - *str = TOUPPER(*str); + *str = toupper(*str); } /* note: we use ((char*)(1)) as terminator - NULL is a valid argument ! */ @@ -130,7 +127,6 @@ static inline char * mhl_strmove(char * dest, const char * src) { size_t n = strlen (src) + 1; /* + '\0' */ - /* strictly speaking, this invokes undefined behavior as soon as dest and src are pointers into different objects. */ assert (dest<=src); return memmove(dest, src, n); @@ -169,4 +165,4 @@ static inline char* mhl_str_dir_plus_file(const char* dirname, const char* filen return buffer; } -#endif /* MHL_STRING_H */ +#endif /* __MHL_STRING_H */ diff --git a/mhl/types.h b/mhl/types.h index 977c27a2c..1f8400299 100644 --- a/mhl/types.h +++ b/mhl/types.h @@ -4,15 +4,13 @@ */ -#ifndef MHL_TYPES_H -#define MHL_TYPES_H +#ifndef __MHL_TYPES_H +#define __MHL_TYPES_H -#if !defined(__bool_true_false_are_defined) && !defined(false) && !defined(true) && !defined(bool) -typedef enum +typedef enum { false = 0, true = 1 } bool; -#endif #endif From dd1b7941d6f0bef3778183739a14e8e63dca742a Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Tue, 10 Feb 2009 13:21:34 +0100 Subject: [PATCH 02/19] Revert "Added enhancements from Sergei which he attached to #241." This reverts commit 34fe2312b4aec7be01470bb7be2453a96b53413a. --- mhl/string.h | 62 ++++++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/mhl/string.h b/mhl/string.h index 47f097f1e..fcbbd864f 100644 --- a/mhl/string.h +++ b/mhl/string.h @@ -51,52 +51,56 @@ static inline void mhl_str_toupper(char* str) *str = toupper(*str); } -/* note: we use ((char*)(1)) as terminator - NULL is a valid argument ! */ -static const char * mhl_s_c_sep__ = (const char *)1; +#define __STR_CONCAT_MAX 32 /* _NEVER_ call this function directly ! */ -static inline char* mhl_str_concat_hlp__(const char* va_start_dummy, ...) +static inline char* __mhl_str_concat_hlp(const char* base, ...) { - char * result; - size_t result_len = 0; - char * p; - const char * chunk; + static const char* arg_ptr[__STR_CONCAT_MAX]; + static size_t arg_sz[__STR_CONCAT_MAX]; + int count = 0; + size_t totalsize = 0; + + if (base) + { + arg_ptr[0] = base; + arg_sz[0] = totalsize = strlen(base); + count = 1; + } va_list args; - va_start(args,va_start_dummy); - while ((chunk = va_arg(args, const char*)) != mhl_s_c_sep__) + va_start(args,base); + char* a; + /* note: we use ((char*)(1)) as terminator - NULL is a valid argument ! */ + while ((a = va_arg(args, char*))!=(char*)1 && count < __STR_CONCAT_MAX ) { - if (chunk) + if (a) { - result_len += strlen (chunk); + arg_ptr[count] = a; + arg_sz[count] = strlen(a); + totalsize += arg_sz[count]; + count++; } } va_end(args); - if (result_len == 0) + if (!count) return mhl_str_dup(""); - /* now as we know how much to copy, allocate the buffer + '\0'*/ - result = (char*)mhl_mem_alloc_u (result_len + 1); - - p = result; - - va_start(args,va_start_dummy); - while ((chunk = va_arg(args, const char*)) != mhl_s_c_sep__) + /* now as we know how much to copy, allocate the buffer */ + char* buffer = (char*)mhl_mem_alloc_u(totalsize+2); + char* current = buffer; + int x=0; + for (x=0; x Date: Tue, 10 Feb 2009 13:21:45 +0100 Subject: [PATCH 03/19] Revert "Call va_end after the iteration as we need to free the list again." This reverts commit 51388bd012248fa30d0d18209ad02d5a2ffb63a5. --- mhl/string.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mhl/string.h b/mhl/string.h index fcbbd864f..da8658406 100644 --- a/mhl/string.h +++ b/mhl/string.h @@ -71,7 +71,7 @@ static inline char* __mhl_str_concat_hlp(const char* base, ...) va_start(args,base); char* a; /* note: we use ((char*)(1)) as terminator - NULL is a valid argument ! */ - while ((a = va_arg(args, char*))!=(char*)1 && count < __STR_CONCAT_MAX ) + while ((a = va_arg(args, char*))!=(char*)1 && count <= 31 ) { if (a) { @@ -81,7 +81,6 @@ static inline char* __mhl_str_concat_hlp(const char* base, ...) count++; } } - va_end(args); if (!count) return mhl_str_dup(""); From d7fa1ecdb456eb4aaf80347ebecea0881d6bed39 Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Tue, 10 Feb 2009 13:21:58 +0100 Subject: [PATCH 04/19] Revert "Fixing a theoretical buffer overflow which was reported by Roland Illig" This reverts commit f148fc29d2737eef087a6ce62d6369b1260a5327. --- mhl/string.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mhl/string.h b/mhl/string.h index da8658406..ee74e1d48 100644 --- a/mhl/string.h +++ b/mhl/string.h @@ -71,7 +71,7 @@ static inline char* __mhl_str_concat_hlp(const char* base, ...) va_start(args,base); char* a; /* note: we use ((char*)(1)) as terminator - NULL is a valid argument ! */ - while ((a = va_arg(args, char*))!=(char*)1 && count <= 31 ) + while ((a = va_arg(args, char*))!=(char*)1) { if (a) { From b87a08ce1ce77da26db3a7603e55107b8e65814c Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Tue, 10 Feb 2009 13:23:28 +0100 Subject: [PATCH 05/19] Revert "fixed #240" This reverts commit 1d8ef0b089bcb6828b0dde62076493178ed185ec. Conflicts: ChangeLog --- ChangeLog | 14 ++++++-------- mhl/escape.h | 3 ++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 74b6e0f9b..e02a81632 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,11 +1,3 @@ -2009-02-04 Enrico Weigelt, metux ITS - - * lib/mc.sh.in: fixes for non-bash shells (fixing #196) - -2009-02-04 Enrico Weigelt, metux ITS - - * mhl/types.h, mhl/escape.h: replaced bool type by stdbool.h (fixing #240) - 2009-02-03 Enrico Weigelt, metux ITS * lib/mc.lib: added patch on #219 by angel_il @@ -24,6 +16,9 @@ * src/find.c, src/main.c, src/panelize.c, src/util.c, src/utilunix.c, * src/widget.c, src/widget.h, src/wtools.c, vfs/fish.c: fixed shell escaping issues in commandline completion engine + +2009-01-31 Enrico Weigelt, metux ITS + * replaced buggy concat_dir_and_file() by mhl_str_dir_plus_file() (in mhl/string.h) 2009-01-30 Enrico Weigelt, metux ITS @@ -45,6 +40,9 @@ * mhl/escape.h, src/complete.c, vfs/fish.c: introduced new type SHELL_ESCAPED_STR for more type safety + +2009-01-27 Enrico Weigelt, metux IT service + * mhl/escape.h, mhl/string.h: fixed comments to use /* ... */ 2009-01-27 Sergei Trofimovich diff --git a/mhl/escape.h b/mhl/escape.h index ed25b608a..2ec4e0d46 100644 --- a/mhl/escape.h +++ b/mhl/escape.h @@ -5,7 +5,8 @@ #include #include -#include + +#include #define mhl_shell_escape_toesc(x) \ (((x)==' ')||((x)=='!')||((x)=='#')||((x)=='$')||((x)=='%')|| \ From d6da1ead5c8eeb91eaa7cc80648cfbc87ac1ff92 Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Tue, 10 Feb 2009 13:24:04 +0100 Subject: [PATCH 06/19] Revert "cleanup: mhl_str_dir_plus_file(): int -> size_t (suggested by Andrew Borodin)" This reverts commit 80a68972718b68c5c5ae050999b187f1676c653b. --- mhl/string.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mhl/string.h b/mhl/string.h index ee74e1d48..f4c56e5ec 100644 --- a/mhl/string.h +++ b/mhl/string.h @@ -149,11 +149,11 @@ static inline char* mhl_str_dir_plus_file(const char* dirname, const char* filen filename++; /* skip trailing slashes on dirname */ - size_t dnlen = strlen(dirname); - while ((dnlen != 0) && (dirname[dnlen-1]=='/')) + int dnlen = strlen(dirname); + while (dnlen && (dirname[dnlen-1]=='/')) dnlen--; - size_t fnlen = strlen(filename); + int fnlen = strlen(filename); char* buffer = mhl_mem_alloc_z(dnlen+fnlen+2); /* enough space for dirname, /, filename, zero */ char* ptr = buffer; From 1f656eb6be758d09c1bdccce887cc540b9507868 Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Tue, 10 Feb 2009 13:24:32 +0100 Subject: [PATCH 07/19] Revert "build fix: added missing declaration of mhl_dir_plus_file (reported by andrew_b)" This reverts commit c697fb3753fe9d3daddfed545115942506b90a23. --- vfs/smbfs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/vfs/smbfs.c b/vfs/smbfs.c index e027da80c..f4d2345f1 100644 --- a/vfs/smbfs.c +++ b/vfs/smbfs.c @@ -49,8 +49,6 @@ #include -#include - #include "vfs.h" #include "vfs-impl.h" #include "smbfs.h" From 5bbeba0b8b97903177eec1926f264f3151f0a34f Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Tue, 10 Feb 2009 13:24:57 +0100 Subject: [PATCH 08/19] Revert "mhl: mhl_shell_unescape_buf(): fixed memory array OOB." This reverts commit 7a51b50d5ce442970eb3909cddae236b53025877. --- mhl/escape.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/mhl/escape.h b/mhl/escape.h index 2ec4e0d46..efc0aac52 100644 --- a/mhl/escape.h +++ b/mhl/escape.h @@ -113,8 +113,6 @@ static inline char* mhl_shell_unescape_buf(char* text) case '`': case '"': case ';': - case '\0': /* end of line! malformed escape string */ - goto out; default: (*writeptr) = c; writeptr++; break; } @@ -126,7 +124,6 @@ static inline char* mhl_shell_unescape_buf(char* text) } readptr++; } -out: *writeptr = 0; return text; From e4e135399f768c1990656f6a5f345d3dcd511657 Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Tue, 10 Feb 2009 13:29:18 +0100 Subject: [PATCH 09/19] Revert "replaced buggy concat_dir_and_file() by mhl_str_dir_plus_file()" This reverts commit 54d6ec88dcb9648d77ae84d063fdaedb76233b39. Conflicts: ChangeLog mhl/string.h src/command.c src/complete.c src/util.c --- edit/edit.c | 5 ++--- edit/editcmd.c | 8 ++++---- edit/editwidget.c | 5 ++--- edit/syntax.c | 7 +++---- edit/usermap.c | 5 ++--- src/charsets.c | 2 +- src/cmd.c | 26 ++++++++++++-------------- src/command.c | 8 ++------ src/complete.c | 16 +++++++--------- src/cons.handler.c | 4 +--- src/cons.saver.c | 2 -- src/ext.c | 7 +++---- src/file.c | 24 ++++++++++++------------ src/filenot.c | 6 ++---- src/find.c | 13 ++++++------- src/hotlist.c | 5 ++--- src/main.c | 5 ++--- src/screen.c | 15 +++++++-------- src/setup.c | 15 +++++++-------- src/treestore.c | 13 ++++++------- src/user.c | 6 ++---- src/util.c | 25 +++++++++++++++++-------- src/util.h | 1 + src/widget.c | 7 +++---- vfs/extfs.c | 11 ++++------- vfs/ftpfs.c | 10 ++++------ vfs/gc.c | 4 +--- vfs/mcfs.c | 2 +- vfs/sfs.c | 4 +--- vfs/smbfs.c | 2 +- vfs/vfs.c | 4 +--- 31 files changed, 119 insertions(+), 148 deletions(-) diff --git a/edit/edit.c b/edit/edit.c index bec84d78d..8f2bca76e 100644 --- a/edit/edit.c +++ b/edit/edit.c @@ -30,9 +30,8 @@ #include #include #include -#include -#include +#include #include "../src/global.h" @@ -2666,7 +2665,7 @@ user_menu (WEdit * edit) int nomark; struct stat status; long start_mark, end_mark; - char *block_file = mhl_str_dir_plus_file (home_dir, BLOCK_FILE); + char *block_file = concat_dir_and_file (home_dir, BLOCK_FILE); int rc = 0; nomark = eval_marks (edit, &start_mark, &end_mark); diff --git a/edit/editcmd.c b/edit/editcmd.c index d223c35cd..8b5f19fac 100644 --- a/edit/editcmd.c +++ b/edit/editcmd.c @@ -28,6 +28,7 @@ #include #include + #include #include #include @@ -35,9 +36,8 @@ #include #include #include -#include -#include +#include #include "../src/global.h" #include "../src/history.h" @@ -235,7 +235,7 @@ edit_save_file (WEdit *edit, const char *filename) return 0; if (*filename != PATH_SEP && edit->dir) { - savename = mhl_str_dir_plus_file (edit->dir, filename); + savename = concat_dir_and_file (edit->dir, filename); filename = catstrs (savename, (char *) NULL); g_free (savename); } @@ -301,7 +301,7 @@ edit_save_file (WEdit *edit, const char *filename) savedir[slashpos - filename + 1] = '\0'; } else savedir = g_strdup ("."); - saveprefix = mhl_str_dir_plus_file (savedir, "cooledit"); + saveprefix = concat_dir_and_file (savedir, "cooledit"); g_free (savedir); fd = mc_mkstemps (&savename, saveprefix, NULL); g_free (saveprefix); diff --git a/edit/editwidget.c b/edit/editwidget.c index 8ae8cf0e8..2b248a069 100644 --- a/edit/editwidget.c +++ b/edit/editwidget.c @@ -33,9 +33,8 @@ #include #include #include -#include -#include +#include #include "../src/global.h" @@ -175,7 +174,7 @@ edit_file (const char *_file, int line) WButtonBar *edit_bar; if (!made_directory) { - char *dir = mhl_str_dir_plus_file (home_dir, EDIT_DIR); + char *dir = concat_dir_and_file (home_dir, EDIT_DIR); made_directory = (mkdir (dir, 0700) != -1 || errno == EEXIST); g_free (dir); } diff --git a/edit/syntax.c b/edit/syntax.c index 2cfe97628..23e8b6ccd 100644 --- a/edit/syntax.c +++ b/edit/syntax.c @@ -30,9 +30,8 @@ #include #include #include -#include -#include +#include #include "../src/global.h" @@ -1027,7 +1026,7 @@ edit_read_syntax_file (WEdit * edit, char ***pnames, const char *syntax_file, f = fopen (syntax_file, "r"); if (!f){ - lib_file = mhl_str_dir_plus_file (mc_home, "syntax" PATH_SEP_STR "Syntax"); + lib_file = concat_dir_and_file (mc_home, "syntax" PATH_SEP_STR "Syntax"); f = fopen (lib_file, "r"); g_free (lib_file); if (!f) @@ -1189,7 +1188,7 @@ edit_load_syntax (WEdit *edit, char ***pnames, const char *type) if (!*edit->filename && !type) return; } - f = mhl_str_dir_plus_file (home_dir, SYNTAX_FILE); + f = concat_dir_and_file (home_dir, SYNTAX_FILE); r = edit_read_syntax_file (edit, pnames, f, edit ? edit->filename : 0, get_first_editor_line (edit), type); if (r == -1) { diff --git a/edit/usermap.c b/edit/usermap.c index ebb6880cc..af0f02343 100644 --- a/edit/usermap.c +++ b/edit/usermap.c @@ -26,12 +26,11 @@ #include #include #include + #include #include #include -#include - #include "../src/global.h" #include "edit.h" @@ -597,7 +596,7 @@ edit_load_user_map(WEdit *edit) if (edit_key_emulation != EDIT_KEY_EMULATION_USER) return TRUE; - file = mhl_str_dir_plus_file(home_dir, MC_USERMAP); + file = concat_dir_and_file(home_dir, MC_USERMAP); if (stat(file, &s) < 0) { char *msg = g_strdup_printf(_("%s not found!"), file); diff --git a/src/charsets.c b/src/charsets.c index f2e69e0b2..10bbefc91 100644 --- a/src/charsets.c +++ b/src/charsets.c @@ -50,7 +50,7 @@ load_codepages_list (void) extern int display_codepage; char *default_codepage = NULL; - fname = mhl_str_dir_plus_file (mc_home, CHARSETS_INDEX); + fname = concat_dir_and_file (mc_home, CHARSETS_INDEX); if (!(f = fopen (fname, "r"))) { fprintf (stderr, _("Warning: file %s not found\n"), fname); g_free (fname); diff --git a/src/cmd.c b/src/cmd.c index f82165c96..7892bd3ad 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -34,8 +34,6 @@ #endif #include -#include - #include "global.h" #include "cmd.h" /* Our definitions */ #include "fileopctx.h" /* file_op_context_new() */ @@ -364,7 +362,7 @@ mkdir_cmd (void) if (dir[0] == '/' || dir[0] == '~') absdir = g_strdup (dir); else - absdir = mhl_str_dir_plus_file (current_panel->cwd, dir); + absdir = concat_dir_and_file (current_panel->cwd, dir); save_cwds_stat (); if (my_mkdir (absdir, 0777) == 0) { @@ -570,10 +568,10 @@ void ext_cmd (void) _(" Which extension file you want to edit? "), 0, 2, _("&User"), _("&System Wide")); } - extdir = mhl_str_dir_plus_file (mc_home, MC_LIB_EXT); + extdir = concat_dir_and_file (mc_home, MC_LIB_EXT); if (dir == 0){ - buffer = mhl_str_dir_plus_file (home_dir, MC_USER_EXT); + buffer = concat_dir_and_file (home_dir, MC_USER_EXT); check_for_default (extdir, buffer); do_edit (buffer); g_free (buffer); @@ -600,7 +598,7 @@ menu_edit_cmd (int where) _("&Local"), _("&User"), _("&System Wide") ); - menufile = mhl_str_dir_plus_file (mc_home, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU); + menufile = concat_dir_and_file (mc_home, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU); switch (dir) { case 0: @@ -609,12 +607,12 @@ menu_edit_cmd (int where) break; case 1: - buffer = mhl_str_dir_plus_file (home_dir, where ? CEDIT_HOME_MENU : MC_HOME_MENU); + buffer = concat_dir_and_file (home_dir, where ? CEDIT_HOME_MENU : MC_HOME_MENU); check_for_default (menufile, buffer); break; case 2: - buffer = mhl_str_dir_plus_file (mc_home, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU); + buffer = concat_dir_and_file (mc_home, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU); break; default: @@ -673,10 +671,10 @@ edit_syntax_cmd (void) _(" Which syntax file you want to edit? "), 0, 2, _("&User"), _("&System Wide")); } - extdir = mhl_str_dir_plus_file (mc_home, "syntax" PATH_SEP_STR "Syntax"); + extdir = concat_dir_and_file (mc_home, "syntax" PATH_SEP_STR "Syntax"); if (dir == 0) { - buffer = mhl_str_dir_plus_file (home_dir, SYNTAX_FILE); + buffer = concat_dir_and_file (home_dir, SYNTAX_FILE); check_for_default (extdir, buffer); do_edit (buffer); g_free (buffer); @@ -807,8 +805,8 @@ compare_dir (WPanel *panel, WPanel *other, enum CompareMode mode) } /* Thorough compare on, do byte-by-byte comparison */ - src_name = mhl_str_dir_plus_file (panel->cwd, source->fname); - dst_name = mhl_str_dir_plus_file (other->cwd, target->fname); + src_name = concat_dir_and_file (panel->cwd, source->fname); + dst_name = concat_dir_and_file (other->cwd, target->fname); if (compare_files (src_name, dst_name, source->st.st_size)) do_file_mark (panel, i, 1); g_free (src_name); @@ -922,10 +920,10 @@ do_link (int symbolic_link, const char *fname) char *d; /* suggest the full path for symlink */ - s = mhl_str_dir_plus_file (current_panel->cwd, fname); + s = concat_dir_and_file (current_panel->cwd, fname); if (get_other_type () == view_listing) { - d = mhl_str_dir_plus_file (other_panel->cwd, fname); + d = concat_dir_and_file (other_panel->cwd, fname); } else { d = g_strdup (fname); } diff --git a/src/command.c b/src/command.c index e608bf033..9692f0922 100644 --- a/src/command.c +++ b/src/command.c @@ -27,10 +27,6 @@ #include #include -#include -#include -#include - #include "global.h" /* home_dir */ #include "tty.h" #include "widget.h" /* WInput */ @@ -128,7 +124,7 @@ examine_cd (char *path) c = *s; *s = 0; if (*p) { - r = mhl_str_dir_plus_file (p, q); + r = concat_dir_and_file (p, q); result = do_cd (r, cd_parse_command); g_free (r); } @@ -181,7 +177,7 @@ void do_cd_command (char *cmd) } else { char *old = current_panel->cwd; char *new; - new = mhl_str_dir_plus_file (old, cmd+3); + new = concat_dir_and_file (old, cmd+3); sync_tree (new); g_free (new); } diff --git a/src/complete.c b/src/complete.c index 94e18953c..3f8d77877 100644 --- a/src/complete.c +++ b/src/complete.c @@ -26,14 +26,11 @@ #include #include #include + #include #include #include -#include -#include -#include - #include "global.h" #include "tty.h" #include "win.h" @@ -520,7 +517,7 @@ command_completion_function (char *text, int state, INPUT_COMPLETE_FLAGS flags) if (cur_path >= path_end) break; expanded = tilde_expand (*cur_path ? cur_path : "."); - cur_word = mhl_str_dir_plus_file (expanded, text); + cur_word = concat_dir_and_file (expanded, text); g_free (expanded); canonicalize_pathname (cur_word); cur_path = strchr (cur_path, 0) + 1; @@ -815,10 +812,11 @@ try_complete (char *text, int *start, int *end, INPUT_COMPLETE_FLAGS flags) c = *s; *s = 0; if (*cdpath){ - r = mhl_str_dir_plus_file (cdpath, word); - SHOW_C_CTX("try_complete:filename_subst_2"); - matches = completion_matches (r, filename_completion_function, flags); - g_free (r); + r = concat_dir_and_file (cdpath, word); + ignore_filenames = 1; + matches = completion_matches (r, filename_completion_function); + ignore_filenames = 0; + g_free (r); } *s = c; cdpath = s + 1; diff --git a/src/cons.handler.c b/src/cons.handler.c index 1fe35b0b3..b08c2662d 100644 --- a/src/cons.handler.c +++ b/src/cons.handler.c @@ -28,8 +28,6 @@ #endif #include -#include - #include "global.h" #include "tty.h" #include "cons.saver.h" @@ -145,7 +143,7 @@ handle_console_linux (unsigned char action) open ("/dev/null", O_WRONLY); if (tty_name) { /* Exec the console save/restore handler */ - mc_conssaver = mhl_str_dir_plus_file (SAVERDIR, "cons.saver"); + mc_conssaver = concat_dir_and_file (SAVERDIR, "cons.saver"); execl (mc_conssaver, "cons.saver", tty_name, (char *) NULL); } /* Console is not a tty or execl() failed */ diff --git a/src/cons.saver.c b/src/cons.saver.c index 7086cd64e..ccd0647ec 100644 --- a/src/cons.saver.c +++ b/src/cons.saver.c @@ -53,8 +53,6 @@ #endif #include -#include - #define LINUX_CONS_SAVER_C #include "cons.saver.h" diff --git a/src/ext.c b/src/ext.c index a0bee25f3..a4468bd8e 100644 --- a/src/ext.c +++ b/src/ext.c @@ -25,9 +25,8 @@ #include #include #include -#include -#include +#include #include "global.h" #include "tty.h" @@ -441,11 +440,11 @@ regex_command (const char *filename, const char *action, int *move_dir) int mc_user_ext = 1; int home_error = 0; - extension_file = mhl_str_dir_plus_file (home_dir, MC_USER_EXT); + extension_file = concat_dir_and_file (home_dir, MC_USER_EXT); if (!exist_file (extension_file)) { g_free (extension_file); check_stock_mc_ext: - extension_file = mhl_str_dir_plus_file (mc_home, MC_LIB_EXT); + extension_file = concat_dir_and_file (mc_home, MC_LIB_EXT); mc_user_ext = 0; } data = load_file (extension_file); diff --git a/src/file.c b/src/file.c index 6400e3e5f..a575b604a 100644 --- a/src/file.c +++ b/src/file.c @@ -922,7 +922,7 @@ copy_dir_dir (FileOpContext *ctx, const char *s, const char *d, int toplevel, } /* Dive into subdir if exists */ if (toplevel && ctx->dive_into_subdirs) { - dest_dir = mhl_str_dir_plus_file (d, x_basename (s)); + dest_dir = concat_dir_and_file (d, x_basename (s)); } else { dest_dir = g_strdup (d); goto dont_mkdir; @@ -968,11 +968,11 @@ copy_dir_dir (FileOpContext *ctx, const char *s, const char *d, int toplevel, continue; /* get the filename and add it to the src directory */ - path = mhl_str_dir_plus_file (s, next->d_name); + path = concat_dir_and_file (s, next->d_name); (*ctx->stat_func) (path, &buf); if (S_ISDIR (buf.st_mode)) { - mdpath = mhl_str_dir_plus_file (dest_dir, next->d_name); + mdpath = concat_dir_and_file (dest_dir, next->d_name); /* * From here, we just intend to recursively copy subdirs, not * the double functionality of copying different when the target @@ -983,7 +983,7 @@ copy_dir_dir (FileOpContext *ctx, const char *s, const char *d, int toplevel, parent_dirs, progress_count, progress_bytes); g_free (mdpath); } else { - dest_file = mhl_str_dir_plus_file (dest_dir, x_basename (path)); + dest_file = concat_dir_and_file (dest_dir, x_basename (path)); return_status = copy_file_file (ctx, path, dest_file, 1, progress_count, progress_bytes, 0); g_free (dest_file); @@ -1173,7 +1173,7 @@ move_dir_dir (FileOpContext *ctx, const char *s, const char *d, destdir = g_strdup (d); move_over = 1; } else - destdir = mhl_str_dir_plus_file (d, x_basename (s)); + destdir = concat_dir_and_file (d, x_basename (s)); if (sbuf.st_dev == dbuf.st_dev && sbuf.st_ino == dbuf.st_ino) { int msize = COLS - 36; @@ -1330,7 +1330,7 @@ recursive_erase (FileOpContext *ctx, const char *s, off_t *progress_count, continue; if (!strcmp (next->d_name, "..")) continue; - path = mhl_str_dir_plus_file (s, next->d_name); + path = concat_dir_and_file (s, next->d_name); if (mc_lstat (path, &buf)) { g_free (path); mc_closedir (reading); @@ -1521,7 +1521,7 @@ compute_dir_size (const char *dirname, off_t *ret_marked, double *ret_total) if (strcmp (dirent->d_name, "..") == 0) continue; - fullname = mhl_str_dir_plus_file (dirname, dirent->d_name); + fullname = concat_dir_and_file (dirname, dirent->d_name); res = mc_lstat (fullname, &s); @@ -1578,7 +1578,7 @@ panel_compute_totals (WPanel *panel, off_t *ret_marked, double *ret_total) double subdir_bytes = 0; dir_name = - mhl_str_dir_plus_file (panel->cwd, panel->dir.list[i].fname); + concat_dir_and_file (panel->cwd, panel->dir.list[i].fname); compute_dir_size (dir_name, &subdir_count, &subdir_bytes); *ret_marked += subdir_count; @@ -1886,7 +1886,7 @@ panel_operate (void *source_panel, FileOperation operation, /* The source and src_stat variables have been initialized before */ #ifdef WITH_FULL_PATHS - source_with_path = mhl_str_dir_plus_file (panel->cwd, source); + source_with_path = concat_dir_and_file (panel->cwd, source); #endif /* WITH_FULL_PATHS */ if (operation == OP_DELETE) { @@ -1901,7 +1901,7 @@ panel_operate (void *source_panel, FileOperation operation, if (temp == NULL) { value = transform_error; } else { - char *temp2 = mhl_str_dir_plus_file (dest, temp); + char *temp2 = concat_dir_and_file (dest, temp); g_free (dest); dest = temp2; temp = NULL; @@ -1979,7 +1979,7 @@ panel_operate (void *source_panel, FileOperation operation, #ifdef WITH_FULL_PATHS g_free (source_with_path); - source_with_path = mhl_str_dir_plus_file (panel->cwd, source); + source_with_path = concat_dir_and_file (panel->cwd, source); #endif /* WITH_FULL_PATHS */ if (operation == OP_DELETE) { @@ -1995,7 +1995,7 @@ panel_operate (void *source_panel, FileOperation operation, if (temp == NULL) value = transform_error; else { - char *temp2 = mhl_str_dir_plus_file (dest, temp); + char *temp2 = concat_dir_and_file (dest, temp); source_with_path = mhl_shell_unescape_buf(source_with_path); temp2 = mhl_shell_unescape_buf(temp2); diff --git a/src/filenot.c b/src/filenot.c index 01e0d784d..f614ce1e6 100644 --- a/src/filenot.c +++ b/src/filenot.c @@ -27,8 +27,6 @@ #include #include -#include - #include "global.h" static char * @@ -39,7 +37,7 @@ get_absolute_name (const char *file) if (file[0] == PATH_SEP) return g_strdup (file); mc_get_current_wd (dir, MC_MAXPATHLEN); - return mhl_str_dir_plus_file (dir, file); + return concat_dir_and_file (dir, file); } static int @@ -62,7 +60,7 @@ my_mkdir_rec (char *s, mode_t mode) return -1; } - p = mhl_str_dir_plus_file (s, ".."); + p = concat_dir_and_file (s, ".."); q = vfs_canon (p); g_free (p); diff --git a/src/find.c b/src/find.c index 9ff1ef720..4b9bc231a 100644 --- a/src/find.c +++ b/src/find.c @@ -25,9 +25,8 @@ #include #include #include -#include -#include +#include #include "global.h" #include "tty.h" @@ -355,7 +354,7 @@ push_directory (const char *dir) dir_stack *new; new = g_new (dir_stack, 1); - new->name = mhl_str_dir_plus_file (dir, NULL); + new->name = concat_dir_and_file (dir, ""); new->prev = dir_stack_base; dir_stack_base = new; } @@ -517,7 +516,7 @@ search_content (Dlg_head *h, const char *directory, const char *filename) int file_fd; int ret_val = 0; - fname = mhl_str_dir_plus_file (directory, filename); + fname = concat_dir_and_file (directory, filename); if (mc_stat (fname, &s) != 0 || !S_ISREG (s.st_mode)){ g_free (fname); @@ -693,7 +692,7 @@ do_search (struct Dlg_head *h) } if (subdirs_left && find_recursively && directory) { /* Can directory be NULL ? */ - char *tmp_name = mhl_str_dir_plus_file (directory, dp->d_name); + char *tmp_name = concat_dir_and_file (directory, dp->d_name); if (!mc_lstat (tmp_name, &tmp_stat) && S_ISDIR (tmp_stat.st_mode)) { push_directory (tmp_name); @@ -753,8 +752,8 @@ make_fullname (const char *dirname, const char *filename) if (strcmp(dirname, ".") == 0 || strcmp(dirname, "."PATH_SEP_STR) == 0) return g_strdup (filename); if (strncmp(dirname, "."PATH_SEP_STR, 2) == 0) - return mhl_str_dir_plus_file (dirname + 2, filename); - return mhl_str_dir_plus_file (dirname, filename); + return concat_dir_and_file (dirname + 2, filename); + return concat_dir_and_file (dirname, filename); } static void diff --git a/src/hotlist.c b/src/hotlist.c index 737c9c174..90678fe00 100644 --- a/src/hotlist.c +++ b/src/hotlist.c @@ -32,12 +32,11 @@ #include #include #include + #include #include #include -#include - #include "global.h" #include "tty.h" /* COLS */ #include "color.h" /* dialog_colors */ @@ -1448,7 +1447,7 @@ load_hotlist (void) } if (!hotlist_file_name) - hotlist_file_name = mhl_str_dir_plus_file (home_dir, HOTLIST_FILENAME); + hotlist_file_name = concat_dir_and_file (home_dir, HOTLIST_FILENAME); hotlist = new_hotlist (); hotlist->type = HL_TYPE_GROUP; diff --git a/src/main.c b/src/main.c index db26945b8..f8a6bb2af 100644 --- a/src/main.c +++ b/src/main.c @@ -29,12 +29,11 @@ #include #include #include + #include #include #include -#include - #include "global.h" #include "tty.h" #include "dir.h" @@ -1137,7 +1136,7 @@ copy_readlink (WPanel *panel) if (S_ISLNK (selection (panel)->st.st_mode)) { char buffer[MC_MAXPATHLEN]; char *p = - mhl_str_dir_plus_file (panel->cwd, selection (panel)->fname); + concat_dir_and_file (panel->cwd, selection (panel)->fname); int i; i = mc_readlink (p, buffer, MC_MAXPATHLEN - 1); diff --git a/src/screen.c b/src/screen.c index 6c3821b74..d1121d8d1 100644 --- a/src/screen.c +++ b/src/screen.c @@ -25,9 +25,8 @@ #include #include #include -#include -#include +#include #include "global.h" #include "tty.h" @@ -710,7 +709,7 @@ display_mini_info (WPanel *panel) char *link, link_target [MC_MAXPATHLEN]; int len; - link = mhl_str_dir_plus_file (panel->cwd, panel->dir.list [panel->selected].fname); + link = concat_dir_and_file (panel->cwd, panel->dir.list [panel->selected].fname); len = mc_readlink (link, link_target, MC_MAXPATHLEN - 1); g_free (link); if (len > 0){ @@ -1975,7 +1974,7 @@ do_enter_on_file_entry (file_entry *fe) return 1; /* Check if the file is executable */ - full_name = mhl_str_dir_plus_file (current_panel->cwd, fe->fname); + full_name = concat_dir_and_file (current_panel->cwd, fe->fname); if (!is_exe (fe->st.st_mode) || !if_link_is_exe (full_name, fe)) { g_free (full_name); return 0; @@ -1994,7 +1993,7 @@ do_enter_on_file_entry (file_entry *fe) char *tmp; int ret; - tmp = mhl_str_dir_plus_file (vfs_get_current_dir (), fe->fname); + tmp = concat_dir_and_file (vfs_get_current_dir (), fe->fname); ret = mc_setctl (tmp, VFS_SETCTL_RUN, NULL); g_free (tmp); /* We took action only if the dialog was shown or the execution @@ -2031,10 +2030,10 @@ chdir_other_panel (WPanel *panel) } if (!S_ISDIR (panel->dir.list [panel->selected].st.st_mode)) { - new_dir = mhl_str_dir_plus_file (panel->cwd, ".."); + new_dir = concat_dir_and_file (panel->cwd, ".."); sel_entry = strrchr(panel->cwd, PATH_SEP); } else - new_dir = mhl_str_dir_plus_file (panel->cwd, panel->dir.list [panel->selected].fname); + new_dir = concat_dir_and_file (panel->cwd, panel->dir.list [panel->selected].fname); change_panel (); do_cd (new_dir, cd_exact); @@ -2100,7 +2099,7 @@ chdir_to_readlink (WPanel *panel) if (*buffer == PATH_SEP) new_dir = g_strdup (buffer); else - new_dir = mhl_str_dir_plus_file (panel->cwd, buffer); + new_dir = concat_dir_and_file (panel->cwd, buffer); change_panel (); do_cd (new_dir, cd_exact); diff --git a/src/setup.c b/src/setup.c index 67dec4a9f..ef4249692 100644 --- a/src/setup.c +++ b/src/setup.c @@ -20,11 +20,10 @@ #include #include + #include #include -#include - #include "global.h" #include "tty.h" #include "dir.h" @@ -282,7 +281,7 @@ save_layout (void) int i; char buffer [BUF_TINY]; - profile = mhl_str_dir_plus_file (home_dir, PROFILE_NAME); + profile = concat_dir_and_file (home_dir, PROFILE_NAME); /* Save integer options */ for (i = 0; layout [i].opt_name; i++){ @@ -299,7 +298,7 @@ save_configure (void) char *profile; int i; - profile = mhl_str_dir_plus_file (home_dir, PROFILE_NAME); + profile = concat_dir_and_file (home_dir, PROFILE_NAME); /* Save integer options */ for (i = 0; int_options[i].opt_name; i++) @@ -347,7 +346,7 @@ save_setup (void) char *profile; saving_setup = 1; - profile = mhl_str_dir_plus_file (home_dir, PROFILE_NAME); + profile = concat_dir_and_file (home_dir, PROFILE_NAME); save_configure (); @@ -482,9 +481,9 @@ setup_init (void) if (profile_name) return profile_name; - profile = mhl_str_dir_plus_file (home_dir, PROFILE_NAME); + profile = concat_dir_and_file (home_dir, PROFILE_NAME); if (!exist_file (profile)){ - inifile = mhl_str_dir_plus_file (mc_home, "mc.ini"); + inifile = concat_dir_and_file (mc_home, "mc.ini"); if (exist_file (inifile)){ g_free (profile); profile = inifile; @@ -507,7 +506,7 @@ load_setup (void) /* mc.lib is common for all users, but has priority lower than ~/.mc/ini. FIXME: it's only used for keys and treestore now */ - global_profile_name = mhl_str_dir_plus_file (mc_home, "mc.lib"); + global_profile_name = concat_dir_and_file (mc_home, "mc.lib"); /* Load integer boolean options */ for (i = 0; int_options[i].opt_name; i++) diff --git a/src/treestore.c b/src/treestore.c index 323b8915c..426b0c289 100644 --- a/src/treestore.c +++ b/src/treestore.c @@ -37,12 +37,11 @@ #include #include #include + #include #include #include -#include - #include "global.h" #include "treestore.h" #include "profile.h" @@ -266,7 +265,7 @@ tree_store_load(void) char *name; int retval; - name = mhl_str_dir_plus_file(home_dir, MC_TREE); + name = concat_dir_and_file(home_dir, MC_TREE); retval = tree_store_load_from(name); g_free(name); @@ -372,7 +371,7 @@ tree_store_save(void) char *name; int retval; - tmp = mhl_str_dir_plus_file(home_dir, MC_TREE_TMP); + tmp = concat_dir_and_file(home_dir, MC_TREE_TMP); retval = tree_store_save_to(tmp); if (retval) { @@ -380,7 +379,7 @@ tree_store_save(void) return retval; } - name = mhl_str_dir_plus_file(home_dir, MC_TREE); + name = concat_dir_and_file(home_dir, MC_TREE); retval = rename(tmp, name); g_free(tmp); @@ -606,7 +605,7 @@ tree_store_mark_checked(const char *subname) if (ts.check_name[0] == PATH_SEP && ts.check_name[1] == 0) name = g_strconcat(PATH_SEP_STR, subname, (char *) NULL); else - name = mhl_str_dir_plus_file(ts.check_name, subname); + name = concat_dir_and_file(ts.check_name, subname); /* Search for the subdirectory */ current = ts.check_start; @@ -796,7 +795,7 @@ tree_store_rescan(const char *dir) continue; } - full_name = mhl_str_dir_plus_file(dir, dp->d_name); + full_name = concat_dir_and_file(dir, dp->d_name); if (mc_lstat(full_name, &buf) != -1) { if (S_ISDIR(buf.st_mode)) tree_store_mark_checked(dp->d_name); diff --git a/src/user.c b/src/user.c index 49e5d06ce..7cb617c3b 100644 --- a/src/user.c +++ b/src/user.c @@ -23,8 +23,6 @@ #include #include -#include - #include "global.h" #include "tty.h" #include "color.h" @@ -723,11 +721,11 @@ user_menu_cmd (struct WEdit *edit_widget) menu = g_strdup (edit_widget ? CEDIT_LOCAL_MENU : MC_LOCAL_MENU); if (!exist_file (menu) || !menu_file_own (menu)){ g_free (menu); - menu = mhl_str_dir_plus_file \ + menu = concat_dir_and_file \ (home_dir, edit_widget ? CEDIT_HOME_MENU : MC_HOME_MENU); if (!exist_file (menu)){ g_free (menu); - menu = mhl_str_dir_plus_file \ + menu = concat_dir_and_file \ (mc_home, edit_widget ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU); } } diff --git a/src/util.c b/src/util.c index aebf59a27..27d5e9dc9 100644 --- a/src/util.c +++ b/src/util.c @@ -35,9 +35,6 @@ #include #include -#include -#include - #include "global.h" #include "profile.h" #include "main.h" /* mc_home */ @@ -694,7 +691,7 @@ load_mc_home_file (const char *filename, char **allocated_filename) char *lang; char *data; - hintfile_base = mhl_str_dir_plus_file (mc_home, filename); + hintfile_base = concat_dir_and_file (mc_home, filename); lang = guess_message_value (); hintfile = g_strconcat (hintfile_base, ".", lang, (char *) NULL); @@ -1253,6 +1250,18 @@ diff_two_paths (const char *first, const char *second) return buf; } +/* If filename is NULL, then we just append PATH_SEP to the dir */ +char * +concat_dir_and_file (const char *dir, const char *file) +{ + int i = strlen (dir); + + if (dir [i-1] == PATH_SEP) + return g_strconcat (dir, file, (char *) NULL); + else + return g_strconcat (dir, PATH_SEP_STR, file, (char *) NULL); +} + /* Append text to GList, remove all entries with the same text */ GList * list_append_unique (GList *list, char *text) @@ -1313,7 +1322,7 @@ mc_mkstemps (char **pname, const char *prefix, const char *suffix) if (strchr (prefix, PATH_SEP) == NULL) { /* Add prefix first to find the position of XXXXXX */ - tmpbase = mhl_str_dir_plus_file (mc_tmpdir (), prefix); + tmpbase = concat_dir_and_file (mc_tmpdir (), prefix); } else { tmpbase = g_strdup (prefix); } @@ -1381,7 +1390,7 @@ load_file_position (const char *filename, long *line, long *column) *column = 0; /* open file with positions */ - fn = mhl_str_dir_plus_file (home_dir, MC_FILEPOS); + fn = concat_dir_and_file (home_dir, MC_FILEPOS); f = fopen (fn, "r"); g_free (fn); if (!f) @@ -1428,8 +1437,8 @@ save_file_position (const char *filename, long line, long column) len = strlen (filename); - tmp = mhl_str_dir_plus_file (home_dir, MC_FILEPOS_TMP); - fn = mhl_str_dir_plus_file (home_dir, MC_FILEPOS); + tmp = concat_dir_and_file (home_dir, MC_FILEPOS_TMP); + fn = concat_dir_and_file (home_dir, MC_FILEPOS); /* open temporary file */ t = fopen (tmp, "w"); diff --git a/src/util.h b/src/util.h index 86009f01b..f68156688 100644 --- a/src/util.h +++ b/src/util.h @@ -66,6 +66,7 @@ char *strip_password (char *path, int has_prefix); const char *strip_home_and_password (const char *dir); const char *extension (const char *); +char *concat_dir_and_file (const char *dir, const char *file); const char *unix_error_string (int error_num); const char *skip_separators (const char *s); const char *skip_numbers (const char *s); diff --git a/src/widget.c b/src/widget.c index f85cc2a88..6328f49fe 100644 --- a/src/widget.c +++ b/src/widget.c @@ -32,9 +32,8 @@ #include #include #include -#include -#include +#include #include "global.h" #include "tty.h" @@ -866,7 +865,7 @@ history_get (const char *input_name) return NULL; if (!*input_name) return NULL; - profile = mhl_str_dir_plus_file (home_dir, HISTORY_FILE_NAME); + profile = concat_dir_and_file (home_dir, HISTORY_FILE_NAME); for (i = 0;; i++) { char key_name[BUF_TINY]; char this_entry[BUF_LARGE]; @@ -904,7 +903,7 @@ history_put (const char *input_name, GList *h) if (!num_history_items_recorded) /* this is how to disable */ return; - profile = mhl_str_dir_plus_file (home_dir, HISTORY_FILE_NAME); + profile = concat_dir_and_file (home_dir, HISTORY_FILE_NAME); if ((i = open (profile, O_CREAT | O_EXCL, S_IRUSR | S_IWUSR)) != -1) close (i); diff --git a/vfs/extfs.c b/vfs/extfs.c index 03bbf254f..d634e3309 100644 --- a/vfs/extfs.c +++ b/vfs/extfs.c @@ -35,9 +35,6 @@ #include #endif #include - -#include - #include "../src/global.h" #include "../src/tty.h" /* enable/disable interrupt key */ #include "../src/wtools.h" /* message() */ @@ -249,7 +246,7 @@ extfs_open_archive (int fstype, const char *name, struct archive **pparc) tmp = name_quote (name, 0); } - mc_extfsdir = mhl_str_dir_plus_file (mc_home, "extfs" PATH_SEP_STR); + mc_extfsdir = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR); cmd = g_strconcat (mc_extfsdir, extfs_prefixes[fstype], " list ", local_name ? local_name : tmp, (char *) NULL); @@ -624,7 +621,7 @@ extfs_cmd (const char *extfs_cmd, struct archive *archive, archive_name = name_quote (extfs_get_archive_name (archive), 0); quoted_localname = name_quote (localname, 0); - mc_extfsdir = mhl_str_dir_plus_file (mc_home, "extfs" PATH_SEP_STR); + mc_extfsdir = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR); cmd = g_strconcat (mc_extfsdir, extfs_prefixes[archive->fstype], extfs_cmd, archive_name, " ", quoted_file, " ", quoted_localname, (char *) NULL); @@ -653,7 +650,7 @@ extfs_run (struct vfs_class *me, const char *file) g_free (p); archive_name = name_quote (extfs_get_archive_name (archive), 0); - mc_extfsdir = mhl_str_dir_plus_file (mc_home, "extfs" PATH_SEP_STR); + mc_extfsdir = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR); cmd = g_strconcat (mc_extfsdir, extfs_prefixes[archive->fstype], " run ", archive_name, " ", q, (char *) NULL); g_free (mc_extfsdir); @@ -1298,7 +1295,7 @@ static int extfs_init (struct vfs_class *me) (void) me; - mc_extfsini = mhl_str_dir_plus_file (mc_home, "extfs" PATH_SEP_STR "extfs.ini"); + mc_extfsini = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR "extfs.ini"); cfg = fopen (mc_extfsini, "r"); /* We may not use vfs_die() message or message or similar, diff --git a/vfs/ftpfs.c b/vfs/ftpfs.c index 68f6967ff..5d8ac1f22 100644 --- a/vfs/ftpfs.c +++ b/vfs/ftpfs.c @@ -44,7 +44,7 @@ What to do with this? int f = !strcmp( remote_path, "/~" ); if (f || !strncmp( remote_path, "/~/", 3 )) { char *s; - s = mhl_str_dir_plus_file( qhome (*bucket), remote_path +3-f ); + s = concat_dir_and_file( qhome (*bucket), remote_path +3-f ); g_free (remote_path); remote_path = s; } @@ -69,8 +69,6 @@ What to do with this? #include #include -#include - #include "../src/global.h" #include "../src/tty.h" /* enable/disable interrupt key */ #include "../src/wtools.h" /* message() */ @@ -557,7 +555,7 @@ ftpfs_load_no_proxy_list (void) if (mc_file) return; - mc_file = mhl_str_dir_plus_file (mc_home, "mc.no_proxy"); + mc_file = concat_dir_and_file (mc_home, "mc.no_proxy"); if (exist_file (mc_file) && (npf = fopen (mc_file, "r"))) { while (fgets (s, sizeof (s), npf)) { @@ -1232,7 +1230,7 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path ftpfs_open_data_connection (me, super, "LIST -la", 0, TYPE_ASCII, 0); else { /* Trailing "/." is necessary if remote_path is a symlink */ - char *path = mhl_str_dir_plus_file (remote_path, "."); + char *path = concat_dir_and_file (remote_path, "."); sock = ftpfs_open_data_connection (me, super, "LIST -la", path, TYPE_ASCII, 0); @@ -1888,7 +1886,7 @@ static int ftpfs_netrc_lookup (const char *host, char **login, char **pass) } /* Load current .netrc */ - netrcname = mhl_str_dir_plus_file (home_dir, ".netrc"); + netrcname = concat_dir_and_file (home_dir, ".netrc"); netrcp = netrc = load_file (netrcname); if (netrc == NULL) { g_free (netrcname); diff --git a/vfs/gc.c b/vfs/gc.c index 8da894618..a0376d8fe 100644 --- a/vfs/gc.c +++ b/vfs/gc.c @@ -31,8 +31,6 @@ #include #include /* is_digit() */ -#include - #include "../src/global.h" #include "../src/tty.h" /* enable/disable interrupt key */ #include "../src/wtools.h" /* message() */ @@ -124,7 +122,7 @@ vfs_getid (struct vfs_class *vclass, const char *dir) vfsid id = NULL; /* append slash if needed */ - dir1 = mhl_str_dir_plus_file (dir, ""); + dir1 = concat_dir_and_file (dir, ""); if (vclass->getid) id = (*vclass->getid) (vclass, dir1); diff --git a/vfs/mcfs.c b/vfs/mcfs.c index 796db653b..07de5a34e 100644 --- a/vfs/mcfs.c +++ b/vfs/mcfs.c @@ -406,7 +406,7 @@ mcfs_get_path (mcfs_connection **mc, const char *path) int f = !strcmp (remote_path, "/~"); if (f || !strncmp (remote_path, "/~/", 3)) { char *s; - s = mhl_str_dir_plus_file (mcfs_gethome (*mc), + s = concat_dir_and_file (mcfs_gethome (*mc), remote_path + 3 - f); g_free (remote_path); remote_path = s; diff --git a/vfs/sfs.c b/vfs/sfs.c index 42df544ef..f4989ca30 100644 --- a/vfs/sfs.c +++ b/vfs/sfs.c @@ -34,8 +34,6 @@ #include #include -#include - #include "../src/global.h" #include "../src/tty.h" /* enable/disable interrupt key */ #include "../src/wtools.h" /* message() */ @@ -338,7 +336,7 @@ static int sfs_init (struct vfs_class *me) (void) me; - mc_sfsini = mhl_str_dir_plus_file (mc_home, "extfs" PATH_SEP_STR "sfs.ini"); + mc_sfsini = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR "sfs.ini"); cfg = fopen (mc_sfsini, "r"); if (!cfg){ diff --git a/vfs/smbfs.c b/vfs/smbfs.c index f4d2345f1..a133fa341 100644 --- a/vfs/smbfs.c +++ b/vfs/smbfs.c @@ -1211,7 +1211,7 @@ smbfs_get_path (smbfs_connection ** sc, const char *path) int f = !strcmp (remote_path, "/~"); if (f || !strncmp (remote_path, "/~/", 3)) { char *s; - s = mhl_str_dir_plus_file ((*sc)->home, remote_path + 3 - f); + s = concat_dir_and_file ((*sc)->home, remote_path + 3 - f); g_free (remote_path); return s; } diff --git a/vfs/vfs.c b/vfs/vfs.c index 39fdc7366..21b5404a3 100644 --- a/vfs/vfs.c +++ b/vfs/vfs.c @@ -38,8 +38,6 @@ #include #include /* is_digit() */ -#include - #include "../src/global.h" #include "../src/tty.h" /* enable/disable interrupt key */ #include "../src/wtools.h" /* message() */ @@ -658,7 +656,7 @@ vfs_canon (const char *path) if (*path != PATH_SEP){ char *local, *result; - local = mhl_str_dir_plus_file (current_dir, path); + local = concat_dir_and_file (current_dir, path); result = vfs_canon (local); g_free (local); From f237a14635ca6f26c083f591391e59782c7f8fb9 Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Tue, 10 Feb 2009 13:52:27 +0100 Subject: [PATCH 10/19] Revert some functions (mhl_mem_free to g_free, etc) Signed-off-by: Patrick Winnertz --- src/command.c | 4 +-- src/complete.c | 16 +++++----- src/file.c | 8 ++--- vfs/fish.c | 80 +++++++++++++++++++++++++------------------------- 4 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/command.c b/src/command.c index 9692f0922..40e913ab7 100644 --- a/src/command.c +++ b/src/command.c @@ -63,7 +63,7 @@ examine_cd (char *path) const char *t; /* Tilde expansion */ - path = mhl_shell_unescape_buf(path); + path = shell_unescape(path); path_tilde = tilde_expand (path); /* Leave space for further expansion */ @@ -135,7 +135,7 @@ examine_cd (char *path) } g_free (q); g_free (path_tilde); -// mhl_mem_free(path); +// g_free(path); return result; } diff --git a/src/complete.c b/src/complete.c index 3f8d77877..ee1b8ef9f 100644 --- a/src/complete.c +++ b/src/complete.c @@ -83,7 +83,7 @@ filename_completion_function (char *text, int state, INPUT_COMPLETE_FLAGS flags) SHOW_C_CTX("filename_completion_function"); if (text && (flags & INPUT_COMPLETE_SHELL_ESC)) - text = mhl_shell_unescape_buf (text); + text = shell_unescape (text); /* If we're starting the match process, initialize us a bit. */ if (!state){ @@ -203,8 +203,8 @@ filename_completion_function (char *text, int state, INPUT_COMPLETE_FLAGS flags) if (temp && (flags & INPUT_COMPLETE_SHELL_ESC)) { - SHELL_ESCAPED_STR e_temp = mhl_shell_escape_dup(temp); - mhl_mem_free (temp); + SHELL_ESCAPED_STR e_temp = shell_escape(temp); + g_free (temp); temp = e_temp.s; } return temp; @@ -460,7 +460,7 @@ command_completion_function (char *text, int state, INPUT_COMPLETE_FLAGS flags) if (!(flags & INPUT_COMPLETE_COMMANDS)) return 0; - text = mhl_shell_unescape_buf(text); + text = shell_unescape(text); flags &= ~INPUT_COMPLETE_SHELL_ESC; if (!state) { /* Initialize us a little bit */ @@ -483,8 +483,8 @@ command_completion_function (char *text, int state, INPUT_COMPLETE_FLAGS flags) p = filename_completion_function (text, state, flags); if (!p) return 0; - SHELL_ESCAPED_STR e_p = mhl_shell_escape_dup(p); - mhl_mem_free(p); + SHELL_ESCAPED_STR e_p = shell_escape(p); + g_free(p); return e_p.s; } @@ -541,8 +541,8 @@ command_completion_function (char *text, int state, INPUT_COMPLETE_FLAGS flags) if ((p = strrchr (found, PATH_SEP)) != NULL) { p++; - SHELL_ESCAPED_STR e_p = mhl_shell_escape_dup(p); - mhl_mem_free(found); + SHELL_ESCAPED_STR e_p = shell_escape(p); + g_free(found); return e_p.s; } return found; diff --git a/src/file.c b/src/file.c index a575b604a..1fa461e1a 100644 --- a/src/file.c +++ b/src/file.c @@ -1809,7 +1809,7 @@ panel_operate (void *source_panel, FileOperation operation, else /* add trailing separator */ if (*dest_dir && strcmp(&dest_dir[strlen(dest_dir)-1], PATH_SEP_STR)) { - dest_dir_ = mhl_str_concat (dest_dir, PATH_SEP_STR); + dest_dir_ = g_concat (dest_dir, PATH_SEP_STR); } else { dest_dir_ = mhl_str_dup (dest_dir); } @@ -1821,7 +1821,7 @@ panel_operate (void *source_panel, FileOperation operation, dest = file_mask_dialog (ctx, operation, cmd_buf, dest_dir_, single_entry, &do_bg); - mhl_mem_free(dest_dir_); + g_free(dest_dir_); if (!dest) { file_op_context_destroy (ctx); @@ -1997,8 +1997,8 @@ panel_operate (void *source_panel, FileOperation operation, else { char *temp2 = concat_dir_and_file (dest, temp); - source_with_path = mhl_shell_unescape_buf(source_with_path); - temp2 = mhl_shell_unescape_buf(temp2); + source_with_path = shell_unescape(source_with_path); + temp2 = shell_unescape(temp2); switch (operation) { case OP_COPY: diff --git a/vfs/fish.c b/vfs/fish.c index 7df2e1e6a..ea1d0c954 100644 --- a/vfs/fish.c +++ b/vfs/fish.c @@ -144,7 +144,7 @@ fish_command (struct vfs_class *me, struct vfs_s_super *super, enable_interrupt_key (); status = write (SUP.sockw, str, strlen (str)); - mhl_mem_free (str); + g_free (str); disable_interrupt_key (); if (status < 0) @@ -168,10 +168,10 @@ fish_free_archive (struct vfs_class *me, struct vfs_s_super *super) close (SUP.sockr); SUP.sockw = SUP.sockr = -1; } - mhl_mem_free (SUP.host); - mhl_mem_free (SUP.user); - mhl_mem_free (SUP.cwdir); - mhl_mem_free (SUP.password); + g_free (SUP.host); + g_free (SUP.user); + g_free (SUP.cwdir); + g_free (SUP.password); } static void @@ -251,7 +251,7 @@ fish_open_archive_int (struct vfs_class *me, struct vfs_s_super *super) p = g_strconcat (_(" fish: Password required for "), SUP.user, " ", (char *) NULL); op = vfs_get_password (p); - mhl_mem_free (p); + g_free (p); if (op == NULL) ERRNOR (EPERM, -1); SUP.password = op; @@ -314,7 +314,7 @@ fish_open_archive (struct vfs_class *me, struct vfs_s_super *super, p = vfs_split_url (strchr (op, ':') + 1, &host, &user, &flags, &password, 0, URL_NOSLASH); - mhl_mem_free (p); + g_free (p); SUP.host = host; SUP.user = user; @@ -341,12 +341,12 @@ fish_archive_same (struct vfs_class *me, struct vfs_s_super *super, op = vfs_split_url (strchr (op, ':') + 1, &host, &user, &flags, 0, 0, URL_NOSLASH); - mhl_mem_free (op); + g_free (op); flags = ((strcmp (host, SUP.host) == 0) && (strcmp (user, SUP.user) == 0) && (flags == SUP.flags)); - mhl_mem_free (host); - mhl_mem_free (user); + g_free (host); + g_free (user); return flags; } @@ -377,7 +377,7 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path) gettimeofday(&dir->timestamp, NULL); dir->timestamp.tv_sec += fish_directory_timeout; - quoted_path = mhl_shell_escape_dup (remote_path); + quoted_path = shell_escape (remote_path); fish_command (me, super, NONE, "#LIST /%s\n" "if `perl -v > /dev/null 2>&1` ; then\n" @@ -454,7 +454,7 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path) "echo '### 500'\n" "fi\n", quoted_path.s, quoted_path.s, quoted_path.s, quoted_path.s, quoted_path.s, quoted_path.s); - mhl_mem_free (quoted_path.s); + g_free (quoted_path.s); ent = vfs_s_generate_entry(me, NULL, dir, 0); while (1) { int res = vfs_s_get_line_interruptible (me, buffer, sizeof (buffer), SUP.sockr); @@ -515,11 +515,11 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path) --linkname_bound; // skip trailing " } - ent->name = mhl_str_dup_range(filename, filename_bound); - mhl_shell_unescape_buf(ent->name); + ent->name = str_dup_range(filename, filename_bound); + shell_unescape(ent->name); - ent->ino->linkname = mhl_str_dup_range(linkname, linkname_bound); - mhl_shell_unescape_buf(ent->ino->linkname); + ent->ino->linkname = str_dup_range(linkname, linkname_bound); + shell_unescape(ent->ino->linkname); } else { // we expect: "escaped-name" if (filename_bound - filename > 2) @@ -532,8 +532,8 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path) --filename_bound; } - ent->name = mhl_str_dup_range(filename, filename_bound); - mhl_shell_unescape_buf(ent->name); + ent->name = str_dup_range(filename, filename_bound); + shell_unescape(ent->name); } break; } @@ -585,7 +585,7 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path) vfs_s_free_entry (me, ent); reply_code = fish_decode_reply(buffer + 4, 0); if (reply_code == COMPLETE) { - mhl_mem_free (SUP.cwdir); + g_free (SUP.cwdir); SUP.cwdir = g_strdup (remote_path); print_vfs_message (_("%s: done."), me->name); return 0; @@ -649,7 +649,7 @@ 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. */ - quoted_name = mhl_shell_escape_dup(name); + quoted_name = shell_escape(name); print_vfs_message(_("fish: store %s: sending command..."), quoted_name.s ); /* FIXME: File size is limited to ULONG_MAX */ @@ -726,14 +726,14 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc (unsigned long) s.st_size); } close(h); - mhl_mem_free(quoted_name.s); + g_free(quoted_name.s); if ((fish_get_reply (me, SUP.sockr, NULL, 0) != COMPLETE) || was_error) ERRNOR (E_REMOTE, -1); return 0; error_return: close(h); fish_get_reply(me, SUP.sockr, NULL, 0); - mhl_mem_free(quoted_name.s); + g_free(quoted_name.s); return -1; } @@ -747,7 +747,7 @@ fish_linear_start (struct vfs_class *me, struct vfs_s_fh *fh, off_t offset) name = vfs_s_fullpath (me, fh->ino); if (!name) return 0; - quoted_name = mhl_shell_escape_dup(name); + quoted_name = shell_escape(name); fh->u.fish.append = 0; /* @@ -771,7 +771,7 @@ fish_linear_start (struct vfs_class *me, struct vfs_s_fh *fh, off_t offset) "echo '### 500'\n" "fi\n", quoted_name.s, quoted_name.s, quoted_name.s, quoted_name.s ); - mhl_mem_free (quoted_name.s); + g_free (quoted_name.s); if (offset != PRELIM) ERRNOR (E_REMOTE, 0); fh->linear = LS_LINEAR_OPEN; fh->u.fish.got = 0; @@ -884,14 +884,14 @@ fish_send_command(struct vfs_class *me, struct vfs_s_super *super, const char *c SHELL_ESCAPED_STR rpath; \ struct vfs_s_super *super; \ if (!(crpath = vfs_s_get_path_mangle (me, mpath, &super, 0))) { \ - mhl_mem_free (mpath); \ + g_free (mpath); \ return -1; \ } \ - rpath = mhl_shell_escape_dup(crpath); \ - mhl_mem_free (mpath); + rpath = shell_escape(crpath); \ + g_free (mpath); #define POSTFIX(flags) \ - mhl_mem_free (rpath.s); \ + g_free (rpath.s); \ return fish_send_command(me, super, buf, flags); static int @@ -914,21 +914,21 @@ static int fish_##name (struct vfs_class *me, const char *path1, const char *pat char *mpath1, *mpath2; \ struct vfs_s_super *super1, *super2; \ if (!(crpath1 = vfs_s_get_path_mangle (me, mpath1 = g_strdup(path1), &super1, 0))) { \ - mhl_mem_free (mpath1); \ + g_free (mpath1); \ return -1; \ } \ if (!(crpath2 = vfs_s_get_path_mangle (me, mpath2 = g_strdup(path2), &super2, 0))) { \ - mhl_mem_free (mpath1); \ - mhl_mem_free (mpath2); \ + g_free (mpath1); \ + g_free (mpath2); \ return -1; \ } \ - SHELL_ESCAPED_STR rpath1 = mhl_shell_escape_dup (crpath1); \ - mhl_mem_free (mpath1); \ - SHELL_ESCAPED_STR rpath2 = mhl_shell_escape_dup (crpath2); \ - mhl_mem_free (mpath2); \ + SHELL_ESCAPED_STR rpath1 = shell_escape (crpath1); \ + g_free (mpath1); \ + SHELL_ESCAPED_STR rpath2 = shell_escape (crpath2); \ + g_free (mpath2); \ g_snprintf(buf, sizeof(buf), string "\n", rpath1.s, rpath2.s, rpath1.s, rpath2.s); \ - mhl_mem_free (rpath1.s); \ - mhl_mem_free (rpath2.s); \ + g_free (rpath1.s); \ + g_free (rpath2.s); \ return fish_send_command(me, super2, buf, OPT_FLUSH); \ } @@ -943,13 +943,13 @@ static int fish_symlink (struct vfs_class *me, const char *setto, const char *pa { SHELL_ESCAPED_STR qsetto; PREFIX - qsetto = mhl_shell_escape_dup (setto); + qsetto = shell_escape (setto); g_snprintf(buf, sizeof(buf), "#SYMLINK %s /%s\n" "ln -s %s /%s 2>/dev/null\n" "echo '### 000'\n", qsetto.s, rpath.s, qsetto.s, rpath.s); - mhl_mem_free (qsetto.s); + g_free (qsetto.s); POSTFIX(OPT_FLUSH); } @@ -1079,7 +1079,7 @@ fish_fill_names (struct vfs_class *me, fill_names_f func) name = g_strconcat ("/#sh:", SUP.user, "@", SUP.host, flags, "/", SUP.cwdir, (char *) NULL); (*func)(name); - mhl_mem_free (name); + g_free (name); super = super->next; } } From 7d0fa9afced7e65468499757607fb3b21a7bf378 Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Tue, 10 Feb 2009 13:54:23 +0100 Subject: [PATCH 11/19] fixed canonicalize_pathname() breakage: fixed str_move() function (memmove semantics) again and add shell_(un)escape again This patch reintroduces fix firstly appeared in (and recently broken by mhl revert) > commit e48cb7c89ff3e54de70130a3de2136a9902a023d > Author: Sergei Trofimovich > Date: Fri Jan 30 09:31:28 2009 +0200 > > mhl: added mhl_strmove() function (memmove semantics) ... > Snippet of man strcpy: > DESCRIPTION > The strcpy() function copies the string pointed to by src, including the terminating > null byte ('\0'), to the buffer pointed to by dest. ___The strings may not overlap___, > and the destination string dest must be large enough to receive the copy. > We used strcpy to move data chunk in memory: "./foo" -> "foo", etc. > > This patch introduces mhl_strmove and fixed canonicalize_pathname. Conflicts: src/util.h Signed-off-by: Patrick Winnertz --- src/util.c | 154 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/util.h | 35 +++++++++++- 2 files changed, 188 insertions(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index 27d5e9dc9..1f7150c6a 100644 --- a/src/util.c +++ b/src/util.c @@ -1531,3 +1531,157 @@ Q_ (const char *s) sep = strchr(result, '|'); return (sep != NULL) ? sep + 1 : result; } + +#define shell_escape_toesc(x) \ + (((x)==' ')||((x)=='!')||((x)=='#')||((x)=='$')||((x)=='%')|| \ + ((x)=='(')||((x)==')')||((x)=='\'')||((x)=='&')||((x)=='~')|| \ + ((x)=='{')||((x)=='}')||((x)=='[')||((x)==']')||((x)=='`')|| \ + ((x)=='?')||((x)=='|')||((x)=='<')||((x)=='>')||((x)==';')|| \ + ((x)=='*')||((x)=='\\')||((x)=='"')) + +#define shell_escape_nottoesc(x) \ + (((x)!=0) && (!shell_escape_toesc((x)))) +/** To be compatible with the general posix command lines we have to escape + strings for the command line + + \params in + string for escaping + + \returns + return escaped string (which needs to be freed later) + */ +char* +shell_escape(const char* src) +{ + GString *str; + char *result = NULL; + + if ((src==NULL)||(!(*src))) + return strdup(""); + + str = g_string_new(""); + + /* look for the first char to escape */ + while (1) + { + char c; + /* copy over all chars not to escape */ + while ((c=(*src)) && shell_escape_nottoesc(c)) + { + g_string_append_c(str,c); + src++; + } + + /* at this point we either have an \0 or an char to escape */ + if (!c) { + result = str->str; + g_string_free(str,FALSE); + return result; + } + + g_string_append_c(str,'\\'); + g_string_append_c(str,c); + src++; + } +} + +/** Unescape paths or other strings for e.g the internal cd + shell-unescape within a given buffer (writing to it!) + + \params src + string for unescaping + + \returns + return unescaped string (which needs to be freed) + */ +char* +shell_unescape(const char* text) +{ + GString *str; + char *result = NULL; + + if (!text) + return NULL; + + + /* look for the first \ - that's quick skipover if there's nothing to escape */ + const char* readptr = text; + while ((*readptr) && ((*readptr)!='\\')) readptr++; + if (!(*readptr)) { + result = g_strdup(text); + return result; + } + str = g_string_new_len(text, readptr - text); + + /* if we're here, we're standing on the first '\' */ + char c; + while ((c = *readptr)) + { + if (c=='\\') + { + readptr++; + switch ((c = *readptr)) + { + case '\0': /* end of string! malformed escape string */ + goto out; + + case 'n': g_string_append_c(str,'\n'); break; + case 'r': g_string_append_c(str,'\r'); break; + case 't': g_string_append_c(str,'\t'); break; + + case ' ': + case '\\': + case '#': + case '$': + case '%': + case '(': + case ')': + case '[': + case ']': + case '{': + case '}': + case '<': + case '>': + case '!': + case '*': + case '?': + case '~': + case '`': + case '"': + case ';': + default: + g_string_append_c(str,c); break; + } + } + else /* got a normal character */ + { + g_string_append_c(str,c); + } + readptr++; + } +out: + + result = str->str; + g_string_free(str,FALSE); + return result; +} + +/** Check if char in pointer contain escape'd chars + + \params in + string for checking + + \returns + return TRUE if string contain escaped chars + otherwise return FALSE + */ +gboolean +shell_is_char_escaped ( const char *in ) +{ + if (in == NULL || !*in || in[0] != '\\') + return FALSE; + if (shell_escape_toesc(in[1])) + return TRUE; + return FALSE; +} + diff --git a/src/util.h b/src/util.h index f68156688..a81777662 100644 --- a/src/util.h +++ b/src/util.h @@ -1,7 +1,9 @@ #ifndef MC_UTIL_H -#define MC_UTIL_H +#define MC_UTIL_H96fc77bc3ee1f2ae2ae7c0a14d3bf08975b4cb66 #include +#include +#include /* Returns its argument as a "modifiable" string. This function is * intended to pass strings to legacy libraries that don't know yet @@ -256,4 +258,35 @@ extern int ascii_alpha_to_cntrl (int ch); #undef Q_ const char *Q_ (const char *s); + +gboolean shell_is_char_escaped ( const char * ); +char *shell_unescape( const char * ); +char *shell_escape( const char * ); + +#define str_dup_range(s_start, s_bound) (g_strndup(s_start, s_bound - s_start)) + +/* + * strcpy is unsafe on overlapping memory areas, so define memmove-alike + * string function. + * Have sense only when: + * * dest <= src + * AND + * * dest and str are pointers to one object (as Roland Illig pointed). + * + * We can't use str*cpy funs here: + * http://kerneltrap.org/mailarchive/openbsd-misc/2008/5/27/1951294 + */ +static inline char * str_move(char * dest, const char * src) +{ + size_t n; + + assert (dest<=src); + + n = strlen (src) + 1; /* + '\0' */ + + return memmove (dest, src, n); +} + +#define MC_PTR_FREE(ptr) do { g_free(ptr); (ptr) = NULL; } while (0) + #endif From 8b7e47d9cca63bff63d4920466b522f63946b0a2 Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Tue, 10 Feb 2009 14:11:30 +0100 Subject: [PATCH 12/19] Last bunch of reverts and removal of mhl/* Signed-off-by: Patrick Winnertz --- mhl/.gitignore | 3 - mhl/README | 103 ----------------------------- mhl/env.h | 8 --- mhl/escape.h | 150 ------------------------------------------- mhl/memory.h | 28 -------- mhl/strhash.h | 49 -------------- mhl/string.h | 171 ------------------------------------------------- mhl/types.h | 16 ----- src/charsets.c | 2 - src/file.c | 10 +-- src/utilunix.c | 12 ++-- vfs/fish.c | 5 +- 12 files changed, 9 insertions(+), 548 deletions(-) delete mode 100644 mhl/.gitignore delete mode 100644 mhl/README delete mode 100644 mhl/env.h delete mode 100644 mhl/escape.h delete mode 100644 mhl/memory.h delete mode 100644 mhl/strhash.h delete mode 100644 mhl/string.h delete mode 100644 mhl/types.h diff --git a/mhl/.gitignore b/mhl/.gitignore deleted file mode 100644 index e99558847..000000000 --- a/mhl/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.deps -Makefile -Makefile.in diff --git a/mhl/README b/mhl/README deleted file mode 100644 index dbf3490bf..000000000 --- a/mhl/README +++ /dev/null @@ -1,103 +0,0 @@ - -Micro helper library. --- - -This is a tiny library of helper functions/macros. - - * MACRO-FUNC: macro w/ function syntax. (might become inline func) - * INLINE-FUNC: inline function (might become macro func) - * MACRO: strictly a macro (may never become a inline func) - --- - -mhl/memory.h: Memory management functions - - * mhl_mem_alloc_u(sz) [MACRO-FUNC] - - Allocate sz bytes on stack, unitialized - - * mhl_mem_alloc_z(sz) [INLINE-FUNC] - - Allocate sz bytes on stack, zero'ed - - * mhl_mem_free(ptr) [INLINE-FUNC] - - Free chunk @ptr (MUST be allocated w/ mhl_mem_alloc_*()), - passing NULL is graciously allowed - - * mhl_mem_realloc(ptr,newsize) -> returns newptr - - Re-allocates a heap chunk, just like realloc() - - * MHL_PTR_FREE(ptr) [MACRO-ONLY] - - like mhl_mem_free(), but with ptr as a variable that gets cleared - (use this as shortcut to "mhl_mem_free(foo); foo = NULL") - -mhl/string.h: String helpers - - * mhl_str_dup(const char*s) -> char* - - [MACRO-FUNC] Safe version of strdup(), when NULL passed, returns strdup("") - - * mhl_str_ndup(const char* s) -> char* - - [MACRO-FUNC] Safe version of strndup(), when NULL passed, returns strdup("") - - * mhl_str_trim(char* s) -> char* - - [INLINE-FUNC] Trims the string (removing leading and trailing whitespacs), - WITHIN the passed buffer, returning the string s itself. - When NULL passed returns NULL. - - * mhl_str_toupper(char* s) -> char* - - [INLINE-FUNC] Converts the string in passed buffer to uppercase, returns that - buffer. When NULL passed returns NULL. - - * mhl_str_concat_1(const char* base, const char* one) -> char* - - [INLINE-FUNC] Concatenates the string one onto the string base and returns the - result in a newly allocated buffer (free it w/ mhl_mem_free()). - For NULL strings, "" is assumed. - - * mhl_str_concat_2(const char* base,const char* one,const char* two) -> char* - mhl_str_concat_3(const char* base,const char* one,const char* two,const char* three) -> char* - mhl_str_concat_4(const char* base,const char* one,const char* two,const char* three,const char* four) -> char* - mhl_str_concat_5(const char* base,const char* one,const char* two,const char* three,const char* four,const char* five) -> char* - mhl_str_concat_6(const char* base,const char* one,const char* two,const char* three,const char* four,const char* five,const char* six) -> char* - mhl_str_concat_7(const char* base,const char* one,const char* two,const char* three,const char* four,const char* five,const char* six,const char* seven) -> char* - - [INLINE-FUNC] Like str_concat_1() but adding more strings. - - * mhl_str_reverse(char* str) -> char* - - [INLINE-FUNC] Reverses the string in passed buffer and returns the buffer ptr itself. - If NULL is passed, returns NULL. - -mhl/escape.h: Shell-style string escaping - - * mhl_shell_escape_toesc(char c) -> bool - - [MACRO-FUNC] returns true when given char has to be escaped - - * mhl_shell_escape_nottoesc(char c) -> bool - - [MACRO-FUNC] opposite of mhl_shell_escape_toesc() - - * mhl_shell_escape_dup(const char* s) -> char* - - [INLINE-FUNC] escapes an string and returns the result in a malloc()'ed chunk - Passing NULL returns an empty malloc()ed string. - - * mhl_shell_unescape_buf(char* s) -> char* - - [INLINE-FUNC] unescapes the string into given buffer (changes buffer!) and - returns ptr to the buffer itself. When NULL passed returns NULL. - -mhl/env.h: Environment variable helpers - - * mhl_getenv_dup(const char* n) -> char* - - [MACRO-FUNC] like getenv() but returns an strdup()'ed copy. When NULL passed, - returns strdup("") diff --git a/mhl/env.h b/mhl/env.h deleted file mode 100644 index 8d5633797..000000000 --- a/mhl/env.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __MHL_ENV_H -#define __MHL_ENV_H - -#include - -#define mhl_getenv_dup(name) (mhl_str_dup(name ? getenv(name) : "")) - -#endif diff --git a/mhl/escape.h b/mhl/escape.h deleted file mode 100644 index efc0aac52..000000000 --- a/mhl/escape.h +++ /dev/null @@ -1,150 +0,0 @@ -#ifndef __MHL_SHELL_ESCAPE_H -#define __MHL_SHELL_ESCAPE_H - -/* Micro helper library: shell escaping functions */ - -#include -#include - -#include - -#define mhl_shell_escape_toesc(x) \ - (((x)==' ')||((x)=='!')||((x)=='#')||((x)=='$')||((x)=='%')|| \ - ((x)=='(')||((x)==')')||((x)=='\'')||((x)=='&')||((x)=='~')|| \ - ((x)=='{')||((x)=='}')||((x)=='[')||((x)==']')||((x)=='`')|| \ - ((x)=='?')||((x)=='|')||((x)=='<')||((x)=='>')||((x)==';')|| \ - ((x)=='*')||((x)=='\\')||((x)=='"')) - -#define mhl_shell_escape_nottoesc(x) \ - (((x)!=0) && (!mhl_shell_escape_toesc((x)))) - -/* type for escaped string - just for a bit more type safety ;-p */ -typedef struct { char* s; } SHELL_ESCAPED_STR; - -/** To be compatible with the general posix command lines we have to escape - strings for the command line - - /params const char * in - string for escaping - /returns - return escaped string (later need to free) - */ -static inline SHELL_ESCAPED_STR mhl_shell_escape_dup(const char* src) -{ - if ((src==NULL)||(!(*src))) - return (SHELL_ESCAPED_STR){ .s = strdup("") }; - - char* buffer = calloc(1, strlen(src)*2+2); - char* ptr = buffer; - - /* look for the first char to escape */ - while (1) - { - char c; - /* copy over all chars not to escape */ - while ((c=(*src)) && mhl_shell_escape_nottoesc(c)) - { - *ptr = c; - ptr++; - src++; - } - - /* at this point we either have an \0 or an char to escape */ - if (!c) - return (SHELL_ESCAPED_STR){ .s = buffer }; - - *ptr = '\\'; - ptr++; - *ptr = c; - ptr++; - src++; - } -} - -/** Unescape paths or other strings for e.g the internal cd - shell-unescape within a given buffer (writing to it!) - - /params const char * in - string for unescaping - /returns - return unescaped string -*/ -static inline char* mhl_shell_unescape_buf(char* text) -{ - if (!text) - return NULL; - - /* look for the first \ - that's quick skipover if there's nothing to escape */ - char* readptr = text; - while ((*readptr) && ((*readptr)!='\\')) readptr++; - if (!(*readptr)) return text; - - /* if we're here, we're standing on the first '\' */ - char* writeptr = readptr; - char c; - while ((c = *readptr)) - { - if (c=='\\') - { - readptr++; - switch ((c = *readptr)) - { - case 'n': (*writeptr) = '\n'; writeptr++; break; - case 'r': (*writeptr) = '\r'; writeptr++; break; - case 't': (*writeptr) = '\t'; writeptr++; break; - - case ' ': - case '\\': - case '#': - case '$': - case '%': - case '(': - case ')': - case '[': - case ']': - case '{': - case '}': - case '<': - case '>': - case '!': - case '*': - case '?': - case '~': - case '`': - case '"': - case ';': - default: - (*writeptr) = c; writeptr++; break; - } - } - else /* got a normal character */ - { - (*writeptr) = *readptr; - writeptr++; - } - readptr++; - } - *writeptr = 0; - - return text; -} - -/** Check if char in pointer contain escape'd chars - - /params const char * in - string for checking - /returns - return TRUE if string contain escaped chars - otherwise return FALSE - */ -static inline bool -mhl_shell_is_char_escaped ( const char *in ) -{ - if (in == NULL || !*in || in[0] != '\\') - return false; - if (mhl_shell_escape_toesc(in[1])) - return true; - return false; -} - -#endif diff --git a/mhl/memory.h b/mhl/memory.h deleted file mode 100644 index b00617700..000000000 --- a/mhl/memory.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef __MHL_MEM -#define __MHL_MEM - -#include -#include - -/* allocate a chunk of stack memory, uninitialized */ -#define mhl_mem_alloc_u(sz) (malloc(sz)) - -/* allocate a chunk of stack memory, zeroed */ -#define mhl_mem_alloc_z(sz) (calloc(1,sz)) - -/* free a chunk of memory from stack, passing NULL does no harm */ -static inline void mhl_mem_free(void* ptr) -{ - if (ptr) free(ptr); -} - -/* free an ptr and NULL it */ -#define MHL_PTR_FREE(ptr) do { mhl_mem_free(ptr); (ptr) = NULL; } while (0); - -/* allocate a chunk on stack - automatically free'd on function exit */ -#define mhl_stack_alloc(sz) (alloca(sz)) - -/* re-alloc memory chunk */ -#define mhl_mem_realloc(ptr,sz) (realloc(ptr,sz)) - -#endif diff --git a/mhl/strhash.h b/mhl/strhash.h deleted file mode 100644 index 1f195053c..000000000 --- a/mhl/strhash.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef __MHL_STRHASH_H -#define __MHL_STRHASH_H - -#include -#include - -static void __mhl_strhash_free_key(void* ptr) -{ - mhl_mem_free(ptr); -} - -static void __mhl_strhash_free_dummy(void* ptr) -{ -} - -typedef hash MHL_STRHASH; - -#define MHL_STRHASH_DECLARE(n) MHL_STRHASH n; - -#define MHL_STRHASH_INIT(h) \ - hash_initialise(h, 997U, \ - hash_hash_string, \ - hash_compare_string, \ - hash_copy_string, \ - __mhl_strhash_free_key, \ - __mhl_strhash_free_dummy) - -#define MHL_STRHASH_DECLARE_INIT(n) \ - MHL_STRHASH_DECLARE(n); \ - MHL_STRHASH_INIT(&n); - -#define MHL_STRHASH_DEINIT(ht) \ - hash_deinitialise(ht) - -static inline void mhl_strhash_addkey(MHL_STRHASH* ht, const char* key, void* value) -{ - hash_insert(ht, (char*)key, value); -} - -static inline void* mhl_strhash_lookup(MHL_STRHASH* ht, const char* key) -{ - void* retptr; - if (hash_retrieve(ht, (char*)key, &retptr)) - return retptr; - else - return NULL; -} - -#endif diff --git a/mhl/string.h b/mhl/string.h deleted file mode 100644 index f4c56e5ec..000000000 --- a/mhl/string.h +++ /dev/null @@ -1,171 +0,0 @@ -#ifndef __MHL_STRING_H -#define __MHL_STRING_H - -#include -#include -#include -#include - -#define mhl_str_dup(str) ((str ? strdup(str) : strdup(""))) -#define mhl_str_ndup(str,len) ((str ? strndup(str,len) : strdup(""))) -#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) -{ - if (!str) return NULL; /* NULL string ?! bail out. */ - - /* find the first non-space */ - char* start; for (start=str; ((*str) && (!isspace(*str))); str++); - - /* only spaces ? */ - if (!(*str)) { *str = 0; return str; } - - /* get the size (cannot be empty - catched above) */ - size_t _sz = strlen(str); - - /* find the proper end */ - char* end; - for (end=(str+_sz-1); ((end>str) && (isspace(*end))); end--); - end[1] = 0; /* terminate, just to be sure */ - - /* if we have no leading spaces, just trucate */ - if (start==str) { end++; *end = 0; return str; } - - /* if it' only one char, dont need memmove for that */ - if (start==end) { str[0]=*start; str[1]=0; return str; } - - /* by here we have a (non-empty) region between start end end */ - memmove(str,start,(end-start+1)); - return str; -} - -static inline void mhl_str_toupper(char* str) -{ - if (str) - for (;*str;str++) - *str = toupper(*str); -} - -#define __STR_CONCAT_MAX 32 -/* _NEVER_ call this function directly ! */ -static inline char* __mhl_str_concat_hlp(const char* base, ...) -{ - static const char* arg_ptr[__STR_CONCAT_MAX]; - static size_t arg_sz[__STR_CONCAT_MAX]; - int count = 0; - size_t totalsize = 0; - - if (base) - { - arg_ptr[0] = base; - arg_sz[0] = totalsize = strlen(base); - count = 1; - } - - va_list args; - va_start(args,base); - char* a; - /* note: we use ((char*)(1)) as terminator - NULL is a valid argument ! */ - while ((a = va_arg(args, char*))!=(char*)1) - { - if (a) - { - arg_ptr[count] = a; - arg_sz[count] = strlen(a); - totalsize += arg_sz[count]; - count++; - } - } - - if (!count) - return mhl_str_dup(""); - - /* now as we know how much to copy, allocate the buffer */ - char* buffer = (char*)mhl_mem_alloc_u(totalsize+2); - char* current = buffer; - int x=0; - for (x=0; x -#include - #include "global.h" #include "charsets.h" diff --git a/src/file.c b/src/file.c index 1fa461e1a..efd19fd01 100644 --- a/src/file.c +++ b/src/file.c @@ -50,10 +50,6 @@ #include #include -#include -#include -#include - #include "global.h" #include "tty.h" #include "eregex.h" @@ -181,7 +177,7 @@ do_transform_source (FileOpContext *ctx, const char *source) for (next_reg = 1, j = 0, k = 0; j < strlen (ctx->dest_mask); j++) { switch (ctx->dest_mask[j]) { case '\\': - if (mhl_shell_is_char_escaped (&ctx->dest_mask[j])){ + if (shell_is_char_escaped (&ctx->dest_mask[j])){ fntarget[k++] = ctx->dest_mask[j++]; fntarget[k++] = ctx->dest_mask[j]; break; @@ -1805,13 +1801,13 @@ panel_operate (void *source_panel, FileOperation operation, */ if (force_single) /* just copy */ - dest_dir_ = mhl_str_dup (dest_dir); + dest_dir_ = g_strdup (dest_dir); else /* add trailing separator */ if (*dest_dir && strcmp(&dest_dir[strlen(dest_dir)-1], PATH_SEP_STR)) { dest_dir_ = g_concat (dest_dir, PATH_SEP_STR); } else { - dest_dir_ = mhl_str_dup (dest_dir); + dest_dir_ = g_strdup (dest_dir); } if (!dest_dir_) { file_op_context_destroy (ctx); diff --git a/src/utilunix.c b/src/utilunix.c index 1b72b2e40..c2afdee2b 100644 --- a/src/utilunix.c +++ b/src/utilunix.c @@ -41,8 +41,6 @@ #endif #include -#include - #include "global.h" #include "execute.h" #include "wtools.h" /* message() */ @@ -428,7 +426,7 @@ canonicalize_pathname (char *path) if (p[0] == PATH_SEP && p[1] == PATH_SEP) { s = p + 1; while (*(++s) == PATH_SEP); - mhl_strmove (p + 1, s); + str_move (p + 1, s); } p++; } @@ -437,7 +435,7 @@ canonicalize_pathname (char *path) p = lpath; while (*p) { if (p[0] == PATH_SEP && p[1] == '.' && p[2] == PATH_SEP) - mhl_strmove (p, p + 2); + str_move (p, p + 2); else p++; } @@ -453,7 +451,7 @@ canonicalize_pathname (char *path) lpath[1] = 0; return; } else { - mhl_strmove (lpath, lpath + 2); + str_move (lpath, lpath + 2); } } @@ -499,10 +497,10 @@ canonicalize_pathname (char *path) if (p[3] != 0) { if (s == lpath && *s == PATH_SEP) { /* "/../foo" -> "/foo" */ - mhl_strmove (s + 1, p + 4); + str_move (s + 1, p + 4); } else { /* "token/../foo" -> "foo" */ - mhl_strmove (s, p + 4); + str_move (s, p + 4); } p = (s > lpath) ? s - 1 : s; continue; diff --git a/vfs/fish.c b/vfs/fish.c index ea1d0c954..869500cd0 100644 --- a/vfs/fish.c +++ b/vfs/fish.c @@ -50,9 +50,6 @@ #include "tcputil.h" #include "../src/unixcompat.h" #include "fish.h" -#include "../mhl/memory.h" -#include "../mhl/string.h" -#include "../mhl/escape.h" int fish_directory_timeout = 900; @@ -880,7 +877,7 @@ fish_send_command(struct vfs_class *me, struct vfs_s_super *super, const char *c #define PREFIX \ char buf[BUF_LARGE]; \ const char *crpath; \ - char *mpath = mhl_str_dup (path); \ + char *mpath = g_strdup (path); \ SHELL_ESCAPED_STR rpath; \ struct vfs_s_super *super; \ if (!(crpath = vfs_s_get_path_mangle (me, mpath, &super, 0))) { \ From 0b0f8e61288682921a49e465b62a4c47585daa6c Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Tue, 10 Feb 2009 15:02:51 +0100 Subject: [PATCH 13/19] Revert "introduced new type SHELL_ESCAPED_STR for more type safety" This reverts commit 90763ba82fc8fa5bc61904961f9e917eca895ada. Conflicts: ChangeLog mhl/escape.h src/complete.c vfs/fish.c Signed-off-by: Patrick Winnertz --- src/complete.c | 9 ++++--- vfs/fish.c | 69 +++++++++++++++++++++++++------------------------- 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/src/complete.c b/src/complete.c index ee1b8ef9f..cf7fa23a4 100644 --- a/src/complete.c +++ b/src/complete.c @@ -998,17 +998,17 @@ complete_engine (WInput *in, int what_to_do) start++; in->completions = try_complete (in->buffer, &start, &end, in->completion_flags); } - if (in->completions){ if (what_to_do & DO_INSERTION || ((what_to_do & DO_QUERY) && !in->completions[1])) { - char * complete = in->completions [0]; - if (insert_text (in, complete, strlen (complete))){ + complete = shell_escape(in->completions [0]); + if (insert_text (in, complete, strlen (complete))){ if (in->completions [1]) beep (); else free_completions (in); } else beep (); + g_free(complete); } if ((what_to_do & DO_QUERY) && in->completions && in->completions [1]) { int maxlen = 0, i, count = 0; @@ -1019,6 +1019,9 @@ complete_engine (WInput *in, int what_to_do) WListbox *query_list; for (p=in->completions + 1; *p; count++, p++) { + q = *p; + *p = shell_escape(*p); + g_free(q); if ((i = strlen (*p)) > maxlen) maxlen = i; } diff --git a/vfs/fish.c b/vfs/fish.c index 869500cd0..cb7e88950 100644 --- a/vfs/fish.c +++ b/vfs/fish.c @@ -355,7 +355,7 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path) char buffer[8192]; struct vfs_s_entry *ent = NULL; FILE *logfile; - SHELL_ESCAPED_STR quoted_path; + char *quoted_path; int reply_code; #if 0 @@ -450,8 +450,8 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path) "else\n" "echo '### 500'\n" "fi\n", - quoted_path.s, quoted_path.s, quoted_path.s, quoted_path.s, quoted_path.s, quoted_path.s); - g_free (quoted_path.s); + quoted_path, quoted_path, quoted_path, quoted_path, quoted_path, quoted_path); + g_free (quoted_path); ent = vfs_s_generate_entry(me, NULL, dir, 0); while (1) { int res = vfs_s_get_line_interruptible (me, buffer, sizeof (buffer), SUP.sockr); @@ -606,7 +606,7 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc struct stat s; int was_error = 0; int h; - SHELL_ESCAPED_STR quoted_name; + char *quoted_name; h = open (localname, O_RDONLY); @@ -647,7 +647,7 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc */ quoted_name = shell_escape(name); - print_vfs_message(_("fish: store %s: sending command..."), quoted_name.s ); + print_vfs_message(_("fish: store %s: sending command..."), quoted_name ); /* FIXME: File size is limited to ULONG_MAX */ if (!fh->u.fish.append) @@ -671,8 +671,8 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc " rest=`expr $rest - $n`\n" "done\n" "}; echo '### 200'\n", - (unsigned long) s.st_size, quoted_name.s, - quoted_name.s, (unsigned long) s.st_size, + (unsigned long) s.st_size, quoted_name, + quoted_name, (unsigned long) s.st_size, (unsigned long) s.st_size); else n = fish_command (me, super, WAIT_REPLY, @@ -688,8 +688,8 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc " rest=`expr $rest - $n`\n" "done\n" "}; echo '### 200'\n", - (unsigned long) s.st_size, quoted_name.s, - quoted_name.s, (unsigned long) s.st_size); + (unsigned long) s.st_size, quoted_name, + quoted_name, (unsigned long) s.st_size); if (n != PRELIM) { close (h); @@ -723,14 +723,14 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc (unsigned long) s.st_size); } close(h); - g_free(quoted_name.s); + g_free(quoted_name); if ((fish_get_reply (me, SUP.sockr, NULL, 0) != COMPLETE) || was_error) ERRNOR (E_REMOTE, -1); return 0; error_return: close(h); fish_get_reply(me, SUP.sockr, NULL, 0); - g_free(quoted_name.s); + g_free(quoted_name); return -1; } @@ -738,7 +738,7 @@ static int fish_linear_start (struct vfs_class *me, struct vfs_s_fh *fh, off_t offset) { char *name; - SHELL_ESCAPED_STR quoted_name; + char *quoted_name; if (offset) ERRNOR (E_NOTSUPP, 0); name = vfs_s_fullpath (me, fh->ino); @@ -767,8 +767,8 @@ fish_linear_start (struct vfs_class *me, struct vfs_s_fh *fh, off_t offset) "else\n" "echo '### 500'\n" "fi\n", - quoted_name.s, quoted_name.s, quoted_name.s, quoted_name.s ); - g_free (quoted_name.s); + quoted_name, quoted_name, quoted_name, quoted_name ); + g_free (quoted_name); if (offset != PRELIM) ERRNOR (E_REMOTE, 0); fh->linear = LS_LINEAR_OPEN; fh->u.fish.got = 0; @@ -877,8 +877,7 @@ fish_send_command(struct vfs_class *me, struct vfs_s_super *super, const char *c #define PREFIX \ char buf[BUF_LARGE]; \ const char *crpath; \ - char *mpath = g_strdup (path); \ - SHELL_ESCAPED_STR rpath; \ + char *rpath, *mpath = g_strdup (path); \ struct vfs_s_super *super; \ if (!(crpath = vfs_s_get_path_mangle (me, mpath, &super, 0))) { \ g_free (mpath); \ @@ -888,7 +887,7 @@ fish_send_command(struct vfs_class *me, struct vfs_s_super *super, const char *c g_free (mpath); #define POSTFIX(flags) \ - g_free (rpath.s); \ + g_free (rpath); \ return fish_send_command(me, super, buf, flags); static int @@ -898,8 +897,8 @@ fish_chmod (struct vfs_class *me, const char *path, int mode) g_snprintf(buf, sizeof(buf), "#CHMOD %4.4o /%s\n" "chmod %4.4o /%s 2>/dev/null\n" "echo '### 000'\n", - mode & 07777, rpath.s, - mode & 07777, rpath.s); + mode & 07777, rpath, + mode & 07777, rpath); POSTFIX(OPT_FLUSH); } @@ -908,7 +907,7 @@ static int fish_##name (struct vfs_class *me, const char *path1, const char *pat { \ char buf[BUF_LARGE]; \ const char *crpath1, *crpath2; \ - char *mpath1, *mpath2; \ + char *rpath1, *rpath2, *mpath1, *mpath2; \ struct vfs_s_super *super1, *super2; \ if (!(crpath1 = vfs_s_get_path_mangle (me, mpath1 = g_strdup(path1), &super1, 0))) { \ g_free (mpath1); \ @@ -919,13 +918,13 @@ static int fish_##name (struct vfs_class *me, const char *path1, const char *pat g_free (mpath2); \ return -1; \ } \ - SHELL_ESCAPED_STR rpath1 = shell_escape (crpath1); \ + rpath1 = shell_escape (crpath1); \ g_free (mpath1); \ - SHELL_ESCAPED_STR rpath2 = shell_escape (crpath2); \ + rpath2 = shell_escape (crpath2); \ g_free (mpath2); \ - g_snprintf(buf, sizeof(buf), string "\n", rpath1.s, rpath2.s, rpath1.s, rpath2.s); \ - g_free (rpath1.s); \ - g_free (rpath2.s); \ + g_snprintf(buf, sizeof(buf), string "\n", rpath1, rpath2, rpath1, rpath2); \ + g_free (rpath1); \ + g_free (rpath2); \ return fish_send_command(me, super2, buf, OPT_FLUSH); \ } @@ -938,15 +937,15 @@ FISH_OP(link, "#LINK /%s /%s\n" static int fish_symlink (struct vfs_class *me, const char *setto, const char *path) { - SHELL_ESCAPED_STR qsetto; + char *qsetto; PREFIX qsetto = shell_escape (setto); g_snprintf(buf, sizeof(buf), "#SYMLINK %s /%s\n" "ln -s %s /%s 2>/dev/null\n" "echo '### 000'\n", - qsetto.s, rpath.s, qsetto.s, rpath.s); - g_free (qsetto.s); + qsetto, rpath, qsetto, rpath); + g_free (qsetto); POSTFIX(OPT_FLUSH); } @@ -971,16 +970,16 @@ fish_chown (struct vfs_class *me, const char *path, int owner, int group) "#CHOWN %s /%s\n" "chown %s /%s 2>/dev/null\n" "echo '### 000'\n", - sowner, rpath.s, - sowner, rpath.s); + sowner, rpath, + sowner, rpath); fish_send_command (me, super, buf, OPT_FLUSH); /* FIXME: what should we report if chgrp succeeds but chown fails? */ g_snprintf (buf, sizeof(buf), "#CHGRP /%s \"/%s\"\n" "chgrp %s \"/%s\" 2>/dev/null\n" "echo '### 000'\n", - sgroup, rpath.s, - sgroup, rpath.s); + sgroup, rpath, + sgroup, rpath); /* fish_send_command(me, super, buf, OPT_FLUSH); */ POSTFIX (OPT_FLUSH) } @@ -993,7 +992,7 @@ static int fish_unlink (struct vfs_class *me, const char *path) "#DELE /%s\n" "rm -f /%s 2>/dev/null\n" "echo '### 000'\n", - rpath.s, rpath.s); + rpath, rpath); POSTFIX(OPT_FLUSH); } @@ -1007,7 +1006,7 @@ static int fish_mkdir (struct vfs_class *me, const char *path, mode_t mode) "#MKD /%s\n" "mkdir /%s 2>/dev/null\n" "echo '### 000'\n", - rpath.s, rpath.s); + rpath, rpath); POSTFIX(OPT_FLUSH); } @@ -1018,7 +1017,7 @@ static int fish_rmdir (struct vfs_class *me, const char *path) "#RMD /%s\n" "rmdir /%s 2>/dev/null\n" "echo '### 000'\n", - rpath.s, rpath.s); + rpath, rpath); POSTFIX(OPT_FLUSH); } From b10bfccfc024080145f19d7f37eabb0916f95fe7 Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Fri, 13 Feb 2009 17:57:01 +0100 Subject: [PATCH 14/19] Remove some of the SHELL_ESCAPE_STR Stuff... Signed-off-by: Patrick Winnertz --- src/complete.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/complete.c b/src/complete.c index cf7fa23a4..6512fa548 100644 --- a/src/complete.c +++ b/src/complete.c @@ -39,7 +39,6 @@ #include "widget.h" #include "wtools.h" #include "main.h" -#include "util.h" #include "key.h" /* XCTRL and ALT macros */ typedef char *CompletionFunction (char * text, int state, INPUT_COMPLETE_FLAGS flags); @@ -203,9 +202,7 @@ filename_completion_function (char *text, int state, INPUT_COMPLETE_FLAGS flags) if (temp && (flags & INPUT_COMPLETE_SHELL_ESC)) { - SHELL_ESCAPED_STR e_temp = shell_escape(temp); - g_free (temp); - temp = e_temp.s; + temp = shell_escape(temp); } return temp; } @@ -483,9 +480,8 @@ command_completion_function (char *text, int state, INPUT_COMPLETE_FLAGS flags) p = filename_completion_function (text, state, flags); if (!p) return 0; - SHELL_ESCAPED_STR e_p = shell_escape(p); - g_free(p); - return e_p.s; + p = shell_escape(p); + return p; } found = NULL; @@ -541,9 +537,9 @@ command_completion_function (char *text, int state, INPUT_COMPLETE_FLAGS flags) if ((p = strrchr (found, PATH_SEP)) != NULL) { p++; - SHELL_ESCAPED_STR e_p = shell_escape(p); + p = shell_escape(p); g_free(found); - return e_p.s; + return p; } return found; From ec3d3cf913a147dc00c53efb05e5147c8e63704d Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 15 Feb 2009 11:52:56 +0200 Subject: [PATCH 15/19] header guard fix Signed-off-by: Sergei Trofimovich --- src/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.h b/src/util.h index a81777662..e108424ed 100644 --- a/src/util.h +++ b/src/util.h @@ -1,5 +1,5 @@ #ifndef MC_UTIL_H -#define MC_UTIL_H96fc77bc3ee1f2ae2ae7c0a14d3bf08975b4cb66 +#define MC_UTIL_H #include #include From 5454c05b38e848e8013aa9edbc23feb3c27a526e Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 15 Feb 2009 11:53:49 +0200 Subject: [PATCH 16/19] mismerge fix: g_concat -> g_strconcat Signed-off-by: Sergei Trofimovich --- src/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/file.c b/src/file.c index efd19fd01..103930104 100644 --- a/src/file.c +++ b/src/file.c @@ -1805,7 +1805,7 @@ panel_operate (void *source_panel, FileOperation operation, else /* add trailing separator */ if (*dest_dir && strcmp(&dest_dir[strlen(dest_dir)-1], PATH_SEP_STR)) { - dest_dir_ = g_concat (dest_dir, PATH_SEP_STR); + dest_dir_ = g_strconcat (dest_dir, PATH_SEP_STR, (char*)0); } else { dest_dir_ = g_strdup (dest_dir); } From d8d26d42fd2831be8564f535906ff2a95d4e3c97 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 15 Feb 2009 11:57:26 +0200 Subject: [PATCH 17/19] fixed mismerge: completion stuff Signed-off-by: Sergei Trofimovich --- src/complete.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/complete.c b/src/complete.c index 6512fa548..32a1d1621 100644 --- a/src/complete.c +++ b/src/complete.c @@ -809,9 +809,8 @@ try_complete (char *text, int *start, int *end, INPUT_COMPLETE_FLAGS flags) *s = 0; if (*cdpath){ r = concat_dir_and_file (cdpath, word); - ignore_filenames = 1; - matches = completion_matches (r, filename_completion_function); - ignore_filenames = 0; + SHOW_C_CTX("try_complete:filename_subst_2"); + matches = completion_matches (r, filename_completion_function, flags); g_free (r); } *s = c; @@ -996,7 +995,7 @@ complete_engine (WInput *in, int what_to_do) } if (in->completions){ if (what_to_do & DO_INSERTION || ((what_to_do & DO_QUERY) && !in->completions[1])) { - complete = shell_escape(in->completions [0]); + char * complete = g_strdup (in->completions [0]); if (insert_text (in, complete, strlen (complete))){ if (in->completions [1]) beep (); @@ -1015,9 +1014,6 @@ complete_engine (WInput *in, int what_to_do) WListbox *query_list; for (p=in->completions + 1; *p; count++, p++) { - q = *p; - *p = shell_escape(*p); - g_free(q); if ((i = strlen (*p)) > maxlen) maxlen = i; } From 81c48ced61a6b53750fb41a2eeb6d1443263d05b Mon Sep 17 00:00:00 2001 From: "Mikhail S. Pobolovets" Date: Mon, 16 Feb 2009 16:10:51 +0200 Subject: [PATCH 18/19] backport: nl.po: update by mpol (#271) Signed-off-by: Mikhail S. Pobolovets --- ChangeLog | 4 +++ po/nl.po | 89 ++++++++++++++++++++++++++++++------------------------- 2 files changed, 52 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog index 74b6e0f9b..ada31c097 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-02-05 Mikhail Pobolovets + + * nl.po: update by mpol (#271) + 2009-02-04 Enrico Weigelt, metux ITS * lib/mc.sh.in: fixes for non-bash shells (fixing #196) diff --git a/po/nl.po b/po/nl.po index d8850e22d..5fce11d07 100644 --- a/po/nl.po +++ b/po/nl.po @@ -9,16 +9,17 @@ msgid "" msgstr "" "Project-Id-Version: mc 4.6.1\n" "Report-Msgid-Bugs-To: mc-devel@gnome.org\n" -"POT-Creation-Date: 2009-01-06 13:46+0200\n" -"PO-Revision-Date: 2005-10-04\n" -"Last-Translator: Leonard den Ottolander \n" +"POT-Creation-Date: 2009-02-13 12:30+0100\n" +"PO-Revision-Date: 2009-02-13\n" +"Last-Translator: Marcel Pol \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" msgid " Choose syntax highlighting " -msgstr "Kies syntax kleuring" +msgstr " Kies syntax kleuring " msgid "< Auto >" msgstr "< Auto >" @@ -56,9 +57,6 @@ msgstr " Bestand %s is te groot " msgid "Macro recursion is too deep" msgstr "Macro-recursie gaat te diep" -msgid " Enter file name: " -msgstr " Geef bestandsnaam: " - msgid "Warning" msgstr "Waarschuwing" @@ -75,7 +73,7 @@ msgid "&Cancel" msgstr "&Afbreken" msgid "The file has been modified in the meantime. Save anyway?" -msgstr "" +msgstr "Bestand is in de tussentijd veranderd. Toch opslaan?" msgid " Error writing to pipe: " msgstr " Fout bij het schrijven naar pijp: " @@ -104,6 +102,9 @@ msgstr " Editor Bewaarmodus " msgid " Save As " msgstr " Opslaan als " +msgid " Enter file name: " +msgstr " Geef bestandsnaam: " + msgid " A file already exists with this name. " msgstr " Er bestaat al een bestand met die naam. " @@ -529,9 +530,8 @@ msgstr "&Leer toetsen..." msgid "Syntax &Highlighting..." msgstr "Synta&X Kleuring..." -#, fuzzy msgid "Save setu&p..." -msgstr "Instellingen &Opslaan" +msgstr "Instellingen &Opslaan..." msgid " File " msgstr " Bestand " @@ -643,19 +643,19 @@ msgstr " Fout in bestand %s, op regel %d " #, c-format msgid "bind: Wrong argument number, bind " -msgstr "" +msgstr "bind: Verkeerd argument nummer, bind " #, c-format msgid "bind: Bad key value `%s'" -msgstr "" +msgstr "bind: Verkeerde waarde toets `%s'" #, c-format msgid "bind: Ehh...no key?" -msgstr "" +msgstr "bind: Ehh...geen toets?" #, c-format msgid "bind: Unknown key: `%s'" -msgstr "" +msgstr "bind: Onbekende toets: `%s'" #, c-format msgid "bind: Unknown command: `%s'" @@ -785,9 +785,11 @@ msgstr "Hoofd-/kleine le&tters" msgid "Sort order" msgstr "Sortering" -#, fuzzy +msgid "Executable first" +msgstr "Uitvoerbare bestanden eerst" + msgid " confirm di&Rectory hotlist delete " -msgstr "Mappen &Snellijst C-\\" +msgstr " bevestig verwijderen mappen &Snellijst " msgid " confirm &Exit " msgstr " B&Evestig afsluiten " @@ -1179,9 +1181,9 @@ msgstr "" msgid " Setup " msgstr " Instellingen " -#, fuzzy, c-format +#,c-format msgid " Setup saved to ~/%s" -msgstr " Instellingen opgeslagen in ~/" +msgstr " Instellingen opgeslagen in ~/%s" #, c-format msgid "" @@ -1270,6 +1272,9 @@ msgid "" "want to copy it from %smc.ext or use that file as an example of how to write " "it." msgstr "" +"De opmaak van het ~/%s bestand is veranderd met versie 3.0. Je kunt het of " +"kopiren van %smc.ext of dat bestand gebruiken als een voorbeeld hoe het te " +"schrijven." msgid " Copy " msgstr " Kopiren " @@ -1753,7 +1758,7 @@ msgid "&Edit - F4" msgstr "Bew&Erken -F4" msgid "&Find recursively" -msgstr "" +msgstr "&Vind recursief" msgid "Start at:" msgstr "Beginnen bij:" @@ -1881,6 +1886,8 @@ msgid "" "\n" " Are you sure you want to remove this entry?" msgstr "" +"\n" +" Weet je zeker dat je deze ingang wilt verwijderen?" msgid "" "\n" @@ -1897,10 +1904,11 @@ msgstr " Startgroep " msgid " Hotlist Load " msgstr " Hotlist laden " -#, fuzzy, c-format +#, c-format msgid "" "MC was unable to write ~/%s file, your old hotlist entries were not deleted" -msgstr " bestand, uw oude hotlist is niet verwijderd" +msgstr "" +"MC kon niet schrijven naar ~/%s bestand, uw oude hotlist is niet verwijderd" #, c-format msgid "Midnight Commander %s" @@ -1948,22 +1956,22 @@ msgid "Modified: %s" msgstr "Veranderd: %s" #. TRANSLATORS: "Status changed", like in the stat(2) man page -#, fuzzy, c-format +#, c-format msgid "Status: %s" -msgstr "Gecreerd: %s" +msgstr "Status: %s" #, c-format msgid "Dev. type: major %lu, minor %lu" -msgstr "" +msgstr "Dev. type: major %lu, minor %lu" #, c-format msgid "Size: %s" msgstr "Grootte: %s" -#, fuzzy, c-format +#, c-format msgid " (%ld block)" msgid_plural " (%ld blocks)" -msgstr[0] " (%ld blokken)" +msgstr[0] " (%ld blok)" msgstr[1] " (%ld blokken)" #, c-format @@ -2477,6 +2485,9 @@ msgstr "Bereken tota&Len" msgid "&Verbose operation" msgstr "Uitvoering met &Weergave" +msgid "Mkdir autoname" +msgstr "" + msgid "&Fast dir reload" msgstr "Snel herle&Zen" @@ -2619,16 +2630,16 @@ msgstr "Eigenaar" msgid "Group" msgstr "Groep" -#, fuzzy, c-format +#, c-format msgid "%s byte" msgid_plural "%s bytes" -msgstr[0] "%s bytes" +msgstr[0] "%s byte" msgstr[1] "%s bytes" -#, fuzzy, c-format +#, c-format msgid "%s in %d file" msgid_plural "%s in %d files" -msgstr[0] "%s bytes in %d bestand(en)" +msgstr[0] "%s bytes in %d bestand" msgstr[1] "%s bytes in %d bestand(en)" msgid "" @@ -2706,12 +2717,6 @@ msgstr "Met ingebouwde editor\n" msgid "Using system-installed S-Lang library" msgstr "Door het systeem genstalleerd S-Lang bibliotheek zal gebruikt worden." -msgid "Using included S-Lang library" -msgstr "Bijgesloten S-Lang bibliotheek zal gebruikt worden." - -msgid "with termcap database" -msgstr "met termcap database" - msgid "with terminfo database" msgstr "met terminfo database" @@ -2845,9 +2850,6 @@ msgstr "%b %e %H:%M" msgid "%b %e %Y" msgstr "%b %e %Y" -msgid "(invalid)" -msgstr "" - #, c-format msgid "%s is not a directory\n" msgstr "%s is geen map\n" @@ -2966,9 +2968,8 @@ msgstr "" msgid " Goto Address " msgstr " Ga naar adres " -#, fuzzy msgid " Invalid address " -msgstr " Ongeldig wachtwoord " +msgstr " Ongeldig adres " msgid " Enter regexp:" msgstr " Geef reguliere expressie:" @@ -3604,6 +3605,12 @@ msgstr "Interne fout:" msgid "Changes to file lost" msgstr "Wijzigingen zijn verloren" +#~ msgid "Using included S-Lang library" +#~ msgstr "Bijgesloten S-Lang bibliotheek zal gebruikt worden." + +#~ msgid "with termcap database" +#~ msgstr "met termcap database" + #~ msgid "&Home" #~ msgstr "&Home" From bb059059d5de0dd342708568e6bef23decf437d6 Mon Sep 17 00:00:00 2001 From: "Mikhail S. Pobolovets" Date: Tue, 17 Feb 2009 20:05:25 +0200 Subject: [PATCH 19/19] backport: lt.po: update by stikonas (#274) Signed-off-by: Mikhail S. Pobolovets --- ChangeLog | 5 + po/lt.po | 504 ++++++++++++++++++++++++++---------------------------- 2 files changed, 243 insertions(+), 266 deletions(-) diff --git a/ChangeLog b/ChangeLog index ada31c097..e2a61cdf0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ + +2009-02-17 Mikhail Pobolovets + + * lt.po: update by stikonas (#274) + 2009-02-05 Mikhail Pobolovets * nl.po: update by mpol (#271) diff --git a/po/lt.po b/po/lt.po index 58b288197..3a395cf62 100644 --- a/po/lt.po +++ b/po/lt.po @@ -8,14 +8,13 @@ msgstr "" "Project-Id-Version: mc 4.6.1\n" "Report-Msgid-Bugs-To: mc-devel@gnome.org\n" "POT-Creation-Date: 2009-01-06 13:46+0200\n" -"PO-Revision-Date: 2006-02-05 00:36+0100\n" -"Last-Translator: Vaidrius Petrauskas \n" +"PO-Revision-Date: 2009-02-16 19:45+0300\n" +"Last-Translator: Andrius Štikonas \n" "Language-Team: Lithuanian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%" -"100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2;\n" msgid " Choose syntax highlighting " msgstr " Parinkite sintaksės ryškinimą " @@ -28,7 +27,7 @@ msgstr "< Įkelti esamą sintaksę iš naujo >" #, c-format msgid " Cannot open %s for reading " -msgstr " Nepavyko atverti „%s“ skaitymui " +msgstr " Nepavyko atverti %s skaitymui " msgid "Error" msgstr "Klaida" @@ -43,27 +42,27 @@ msgstr " Nepavyko atverti konvejerio skaitymui: %s " #, c-format msgid " Cannot get size/permissions for %s " -msgstr " Nepavyko sužinoti rinkmenos „%s“ dydžio/leidimų " +msgstr " Nepavyko sužinoti %s dydžio/leidimų " #, c-format msgid " %s is not a regular file " -msgstr " „%s“ nėra įprastinė rinkmena " +msgstr " %s nėra įprastinis failas " #, c-format msgid " File %s is too large " -msgstr " Rinkmena „%s“ per didelė " +msgstr " Failas %s yra per didelis " msgid "Macro recursion is too deep" -msgstr "Makrosų rekursija per gili" +msgstr "Makrokomandų rekursija yra per gili" msgid " Enter file name: " -msgstr " Įveskite rinkmenos pavadinimą: " +msgstr " Įveskite failo pavadinimą: " msgid "Warning" msgstr "Įspėjimas" msgid " File has hard-links. Detach before saving? " -msgstr "" +msgstr " Failas turi nuorodų. Atjungti prieš išsaugant? " msgid "&Yes" msgstr "&Taip" @@ -75,7 +74,7 @@ msgid "&Cancel" msgstr "&Atsisakyti" msgid "The file has been modified in the meantime. Save anyway?" -msgstr "" +msgstr "Tuo tarpu failas buvo pakeistas. Vis tiek jį išsaugoti?" msgid " Error writing to pipe: " msgstr " Klaida rašant į konvejerį: " @@ -105,46 +104,46 @@ msgid " Save As " msgstr " Įrašyti kaip " msgid " A file already exists with this name. " -msgstr " Rinkmena šiuo pavadinimu jau yra. " +msgstr " Failas šiuo pavadinimu jau yra. " msgid "&Overwrite" msgstr "Perraš&yti" msgid " Cannot save file. " -msgstr " Nepavyko išsaugoti rinkmenos. " +msgstr " Nepavyko išsaugoti failo. " msgid "Cancel" msgstr "Atsisakyti" msgid " Delete macro " -msgstr " Pašalinti makrosą " +msgstr " Pašalinti makrokomandą " msgid " Cannot open temp file " -msgstr " Nepavyko atverti laikinosios rinkmenos " +msgstr " Nepavyko atverti laikino failo " msgid " Cannot open macro file " -msgstr " Nepavyko atverti makroso rinkmenos " +msgstr " Nepavyko atverti makrokomandos failo " msgid " Cannot overwrite macro file " -msgstr " Nepavyko perrašyti makroso rinkmenos " +msgstr " Nepavyko perrašyti makrokomandos failo " msgid " Save macro " -msgstr " Įrašyti makrosą " +msgstr " Įrašyti makrokomandą " msgid " Press the macro's new hotkey: " -msgstr " Nuspauskite naują greitųjų klavišų kombinaciją makrosui: " +msgstr " Nuspauskite naują greitųjų klavišų kombinaciją makrokomandai: " msgid " Press macro hotkey: " -msgstr " Nuspauskite greituosius makroso klavišus: " +msgstr " Nuspauskite greituosius makrokomandų klavišus: " msgid " Load macro " -msgstr " Įkelti makrosą " +msgstr " Įkelti makrokomandą " msgid " Confirm save file? : " -msgstr " Įrašyti rinkmeną? : " +msgstr " Patvirtinti failo įrašymą? : " msgid " Save file " -msgstr " Įrašyti rinkmeną " +msgstr " Įrašyti failą " msgid "&Save" msgstr "Į&rašyti" @@ -153,7 +152,7 @@ msgid "" " Current text was modified without a file save. \n" " Continue discards these changes. " msgstr "" -" Esama rinkmena buvo pakeista ir neįrašyta. \n" +" Dabartinis tekstas buvo pakeistas ir neįrašytas į failą. \n" " Tęsdami atmesite visus pakeitimus. " msgid "C&ontinue" @@ -196,7 +195,7 @@ msgid "&Backwards" msgstr "At&bulai" msgid "&Regular expression" -msgstr "&Reguliari išraiška" +msgstr "Reguliari &išraiška" msgid "&Whole words only" msgstr "&Tik žodžius" @@ -219,11 +218,8 @@ msgstr " Pakeisti " msgid "Search" msgstr "Paieška" -msgid "" -" Invalid regular expression, or scanf expression with too many conversions " -msgstr "" -" Klaida reguliarioje išraiškoje, arba „scanf“ išraiška turi per daug " -"konvertavimų " +msgid " Invalid regular expression, or scanf expression with too many conversions " +msgstr " Klaida reguliarioje išraiškoje, arba „scanf“ išraiška turi per daug konvertavimų " msgid " Error in replacement format string. " msgstr " Klaida pakeitimo eilutės formate. " @@ -246,7 +242,7 @@ msgid "Quit" msgstr "Išeiti" msgid " File was modified, Save with exit? " -msgstr " Rinkmena pakeista, įrašyti išeinant? " +msgstr " Failas buvo pakeistas, įrašyti išeinant? " msgid "&Cancel quit" msgstr "&Neišeiti" @@ -261,7 +257,7 @@ msgid " Copy to clipboard " msgstr " Kopijuoti į krepšį " msgid " Unable to save to file. " -msgstr " Nepavyko įrašyti į rinkmeną. " +msgstr " Nepavyko įrašyti į failą. " msgid " Cut to clipboard " msgstr " Iškirpti į krepšį " @@ -276,10 +272,10 @@ msgid " Save Block " msgstr " Įrašyti bloką " msgid " Insert File " -msgstr " Įterpti rinkmeną " +msgstr " Įterpti failą " msgid " Cannot insert file. " -msgstr " Nepavyko įterpti rinkmenos. " +msgstr " Nepavyko įterpti failo. " msgid " Sort block " msgstr " Rikiuoti bloką " @@ -351,7 +347,7 @@ msgid " Press any key: " msgstr " Paspauskite bet kurį klavišą: " msgid " Execute Macro " -msgstr " Įvykdyti makrosą " +msgstr " Įvykdyti makrokomandą " msgid "&Dismiss" msgstr "At&mesti" @@ -365,18 +361,18 @@ msgid "" "User: %s\n" "Process ID: %d" msgstr "" -"Rinkmena „%s“ jau taisoma\n" +"Failas „%s“ jau taisoma\n" "Naudotojas: %s\n" "Proceso ID: %d" msgid "File locked" -msgstr "Rinkmena užblokuota" +msgstr "Failas užrakintas" msgid "&Grab lock" -msgstr "&Paimti bloką" +msgstr "&Paimti užraktą" msgid "&Ignore lock" -msgstr "&Ignoruoti bloką" +msgstr "&Ignoruoti užraktą" msgid " About " msgstr " Apie " @@ -399,7 +395,7 @@ msgstr "" " parašytas „Midnight Commander“.\n" msgid "&Open file..." -msgstr "At&verti rinkmeną..." +msgstr "At&verti failą..." msgid "&New C-n" msgstr "&Nauja C-n" @@ -411,10 +407,10 @@ msgid "Save &as... F12" msgstr "Įrašyti &kaip... F12" msgid "&Insert file... F15" -msgstr "Įterpt&i rinkmeną... F15" +msgstr "Įterpt&i failą... F15" msgid "Copy to &file... C-f" -msgstr "Kopijuoti į &rinkmeną C-f" +msgstr "Kopijuoti į &failą C-f" msgid "&User menu... F11" msgstr "Naudotojo meni&u F11" @@ -429,7 +425,7 @@ msgid "&New C-x k" msgstr "&Nauja C-x k" msgid "Copy to &file... " -msgstr "Kopijuoti į &rinkmeną... " +msgstr "Kopijuoti į &failą... " msgid "&Toggle Mark F3" msgstr "Keis&ti žymėjimą F3" @@ -477,16 +473,16 @@ msgid "Insert &literal... C-q" msgstr "Įterpti simbo&lį... C-q" msgid "&Refresh screen C-l" -msgstr "atnau&jinti ekraną C-l" +msgstr "Atnau&jinti ekraną C-l" msgid "&Start record macro C-r" -msgstr "Pradėti makro&so įrašą C-r" +msgstr "Pradėti makroko&mandos įrašą C-r" msgid "&Finish record macro... C-r" -msgstr "&Baigti makroso įrašą... C-r" +msgstr "&Baigti makrokomandos įrašą... C-r" msgid "&Execute macro... C-a, KEY" -msgstr "Pal&eisti makrosą... C-a,KLV" +msgstr "Pal&eisti makrokomandą... C-a, KLV" msgid "Delete macr&o... " msgstr "Šalinti makr&osą..." @@ -513,7 +509,7 @@ msgid "&Mail... " msgstr "Paš&tas..." msgid "&Execute macro... C-x e, KEY" -msgstr "V&ykdyti makrosą... C-x e,KL" +msgstr "V&ykdyti makrokomandą... C-x e, KL" msgid "'ispell' s&pell check M-$" msgstr "„ispell“ rašybos patikra M-$" @@ -534,7 +530,7 @@ msgid "Save setu&p..." msgstr "Įrašyti nu&statymus..." msgid " File " -msgstr " Rinkmena " +msgstr " Failas " msgid " Edit " msgstr " Taisa " @@ -576,7 +572,7 @@ msgid "Synta&x highlighting" msgstr "Sintak&sės ryškinimas" msgid "Save file &position" -msgstr "Išsaugoti vietą ri&nkmenoje" +msgstr "Išsaugoti &vietą faile" msgid "Confir&m before saving" msgstr "Patvirtinti pri&eš įrašant" @@ -627,19 +623,19 @@ msgid "PullDn" msgstr "Meniu" msgid " Load syntax file " -msgstr " Įkelti sintaksės rinkmeną " +msgstr " Įkelti sintaksės failą " #, c-format msgid "" " Cannot open file %s \n" " %s " msgstr "" -" Nepavyko atverti rinkmeną „%s“ \n" +" Nepavyko atverti failo %s \n" " %s " #, c-format msgid " Error in file %s on line %d " -msgstr " Klaida rinkmenos %s eilutėje %d " +msgstr " Klaida failo %s eilutėje %d " #, c-format msgid "bind: Wrong argument number, bind " @@ -759,13 +755,13 @@ msgstr "" " nei mes galime pateikti. \n" msgid "&Full file list" -msgstr "Pilnas &rinkmenų sąrašas" +msgstr "Pilnas &failų sąrašas" msgid "&Brief file list" -msgstr "Tru&mpas rinkmenų sąrašas" +msgstr "Tru&mpas failų sąrašas" msgid "&Long file list" -msgstr "I&lgas rinkmenų sąrašas" +msgstr "I&lgas failų sąrašas" msgid "&User defined:" msgstr "Kit&oks:" @@ -834,7 +830,7 @@ msgid "Use &passive mode" msgstr "&Pasyvus režimas" msgid "&Use ~/.netrc" -msgstr "Na&udoti „~/.netrc“" +msgstr "Na&udoti ~/.netrc" msgid "&Always use ftp proxy" msgstr "N&audoti FTP įgaliotajį serverį:" @@ -843,7 +839,7 @@ msgid "sec" msgstr "sek." msgid "ftpfs directory cache timeout:" -msgstr "„ftpfs“ katalogų kešo galiojimas:" +msgstr "ftpfs aplankų podėlio galiojimas:" msgid "ftp anonymous password:" msgstr "ftp anonimo slaptažodis" @@ -852,7 +848,7 @@ msgid "Timeout for freeing VFSs:" msgstr "VFS galiojimas:" msgid " Virtual File System Setting " -msgstr " Virtualios rinkmenų sistemos nustatymai " +msgstr " Virtualios failų sistemos nustatymai " msgid "Quick cd" msgstr "Greitas „cd“" @@ -864,7 +860,7 @@ msgid "Symbolic link filename:" msgstr "Simbolinės nuorodos pavadinimas:" msgid "Existing filename (filename symlink will point to):" -msgstr "Esančios rinkmenos pavad. (į kurią nuoroda bus nukreipta):" +msgstr "Esančio failo pavad. (į kurią nuoroda bus nukreipta):" msgid "Symbolic link" msgstr "Simbolinė nuoroda" @@ -902,7 +898,7 @@ msgstr "\\\\%s\\%s slaptažodis" #, c-format msgid "Warning: file %s not found\n" -msgstr "Įspėjimas: rinkmena %s nerasta\n" +msgstr "Įspėjimas: failas %s nerasta\n" #, c-format msgid "Cannot translate from %s to %s" @@ -1002,7 +998,7 @@ msgid " Size " msgstr " Dydis " msgid " User name " -msgstr " Prisijungimo vardas " +msgstr " Naudotojo vardas " msgid " Chown command " msgstr " „chown“ komanda " @@ -1014,16 +1010,16 @@ msgid "" msgstr "" msgid "Files tagged, want to cd?" -msgstr "Rinkmenos pažymėtos, norite įvykdyti „cd“?" +msgstr "Failai pažymėti, norite įvykdyti „cd“?" msgid "Cannot change directory" -msgstr " Nepavyko pakeisti katalogo " +msgstr " Nepavyko pakeisti aplanko " msgid " View file " -msgstr " Rodyti rinkmeną " +msgstr " Rodyti failą " msgid " Filename:" -msgstr " Rinkmenos pavadinimas:" +msgstr " Failo pavadinimas:" msgid " Filtered view " msgstr " Filtruotas vaizdas " @@ -1032,16 +1028,16 @@ msgid " Filter command and arguments:" msgstr " Filtro komanda ir argumentai:" msgid "Create a new Directory" -msgstr "Sukurti naują katalogą" +msgstr "Sukurti naują aplanką" msgid " Enter directory name:" -msgstr " Įveskite katalogo pavadinimą: " +msgstr " Įveskite aplanko pavadinimą: " msgid " Filter " msgstr " Filtras " msgid " Set expression for filtering filenames" -msgstr " Nustatyti rinkmenų vardų filtro išraišką" +msgstr " Nustatyti failų vardų filtro išraišką" msgid " Malformed regular expression " msgstr " Netaisyklinga reguliari išraiška " @@ -1053,34 +1049,34 @@ msgid " Unselect " msgstr " Atžymėti " msgid "Extension file edit" -msgstr "Plėtinių rinkmenos keitimas" +msgstr "Plėtinių failo keitimas" msgid " Which extension file you want to edit? " -msgstr " Kurią plėtinių rinkmeną norite keisti? " +msgstr " Kurį plėtinių failą norite keisti? " msgid "&User" msgstr "&Naudotojo" msgid "&System Wide" -msgstr "&Sisteminę" +msgstr "&Sisteminį" msgid " Menu edit " msgstr " Meniu keitimas " msgid " Which menu file do you want to edit? " -msgstr " Kurią meniu rinkmeną norite keisti? " +msgstr " Kurį meniu failą norite keisti? " msgid "&Local" -msgstr "&Lokalią" +msgstr "&Vietinį" msgid "Syntax file edit" -msgstr "Sintaksės rinkmenos keitimas" +msgstr "Sintaksės failo keitimas" msgid " Which syntax file you want to edit? " -msgstr " Kurią sintaksės rinkmeną norite keisti? " +msgstr " Kurį sintaksės failą norite keisti? " msgid " Compare directories " -msgstr " Palyginti katalogus " +msgstr " Palyginti aplankus " msgid " Select compare method: " msgstr " Parinkite lyginimo metodą: " @@ -1164,21 +1160,21 @@ msgid " SMB link to machine " msgstr " SMB ryšys " msgid " Undelete files on an ext2 file system " -msgstr " Atkurti „ext2fs“ rinkmenų sistemos rinkmenas " +msgstr " Atkurti ext2 failų sistemos failus" msgid "" " Enter device (without /dev/) to undelete\n" " files on: (F1 for details)" msgstr "" " Nurodykite įtaisą (be „/dev/“) iš kurio\n" -" atkurti rinkmenas: (F1 - pagalba)" +" atkurti failus: (F1 - pagalba)" msgid " Setup " msgstr " Nustatymai " -#, fuzzy, c-format +#, c-format msgid " Setup saved to ~/%s" -msgstr " Nustatymai įrašyti į ~/" +msgstr " Nustatymai įrašyti į ~/%s" #, c-format msgid "" @@ -1189,7 +1185,7 @@ msgstr "" " %s " msgid " Cannot execute commands on non-local filesystems" -msgstr "Negalima vykdyti komandą nevietinėje rinkmenų sistemoje" +msgstr "Negalima vykdyti komandų nevietinėje failų sistemoje" msgid " The shell is already running a command " msgstr " Aplinkoje jau vykdoma komanda " @@ -1219,7 +1215,7 @@ msgid "&Inode" msgstr "„&Inode“" msgid "Cannot read directory contents" -msgstr "Nepavyko perskaityti katalogo turinio" +msgstr "Nepavyko perskaityti aplanko turinio" #, c-format msgid "Press any key to continue..." @@ -1238,37 +1234,27 @@ msgid "" " Cannot create temporary command file \n" " %s " msgstr "" -" Nepavyko sukurti laikinos komandų rinkmenos \n" -" %s " +" Nepavyko sukurti laikino komandų failo \n" +" %s " msgid " Parameter " msgstr " Parametras " #, c-format msgid " %s%s file error" -msgstr " „%s%s“ rinkmenos klaida" +msgstr " %s%s failo klaida" #, c-format -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." -msgstr "" -"3.0 versijoje pasikeitė „%smc.ext“ rinkmenos formatas. Panašu, kad įdiegimas " -"nepavyko. Įsidiekite naują „Midnight Commander“ versiją." +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." +msgstr "3.0 versijoje pasikeitė „%smc.ext“ failo formatas. Panašu, kad įdiegimas nepavyko. Įsidiekite naują „Midnight Commander“ versiją." #, c-format msgid " ~/%s file error " -msgstr " „ „~/%s“ rinkmenos klaida " +msgstr " ~/%s failo klaida " #, c-format -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." -msgstr "" -"3.0 versijoje pasikeitė „~/%s“ rinkmenos formatas. Galite ją nukopijuoti iš " -"„%smc.ext“ arba naudoti tą rinkmeną kaip pavyzdį naujos parašymui." +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." +msgstr "3.0 versijoje pasikeitė ~/%s failo formatas. Galite jį nukopijuoti iš %smc.ext arba naudoti tą failą kaip pavyzdį naujo rašymui." msgid " Copy " msgstr " Kopijuoti " @@ -1283,7 +1269,7 @@ msgid " Invalid target mask " msgstr " Netaisyklingas paskirties formatas " msgid " Cannot make the hardlink " -msgstr " Nepavyko sukurti „hardlink“ " +msgstr " Nepavyko sukurti nuorodos " #, c-format msgid "" @@ -1298,8 +1284,7 @@ msgid "" "\n" " Option Stable Symlinks will be disabled " msgstr "" -" Negalima sukurti stabilios simb. nuorodos tarp nevietinių rinkmenų " -"sistemų: \n" +" Negalima sukurti stabilios simb. nuorodos tarp nevietinių failų sistemų: \n" "\n" " „Stabilių simb. nuorodų“ nustatymas bus išjungtas " @@ -1316,7 +1301,7 @@ msgid "" " Cannot overwrite directory \"%s\" \n" " %s " msgstr "" -" Nepavyko perrašyti katalogo „%s“ \n" +" Nepavyko perrašyti aplanko „%s“ \n" " %s " #, c-format @@ -1324,19 +1309,19 @@ msgid "" " Cannot stat source file \"%s\" \n" " %s " msgstr "" -" Nepavyko nustatyti rinkmenos „%s“ būklės („stat“) \n" +" Nepavyko nustatyti failo „%s“ būklės („stat“) \n" " %s " #, c-format msgid " `%s' and `%s' are the same file " -msgstr " „%s“ ir „%s“ yra ta pati rinkmena " +msgstr " „%s“ ir „%s“ yra tas pats failas " #, c-format msgid "" " Cannot create special file \"%s\" \n" " %s " msgstr "" -" Nepavyko sukurti specialiosios rinkmenos „%s“ \n" +" Nepavyko sukurti specialiojo failo „%s“ \n" " %s " #, c-format @@ -1344,7 +1329,7 @@ msgid "" " Cannot chown target file \"%s\" \n" " %s " msgstr "" -" Nepavyko pakeisti rinkmenos „%s“ nuosavybės teisių \n" +" Nepavyko pakeisti failo „%s“ nuosavybės teisių \n" " %s " #, c-format @@ -1352,7 +1337,7 @@ msgid "" " Cannot chmod target file \"%s\" \n" " %s " msgstr "" -" Nepavyko pakeisti rinkmenos „%s“ režimo \n" +" Nepavyko pakeisti failo „%s“ režimo \n" " %s " #, c-format @@ -1360,18 +1345,18 @@ msgid "" " Cannot open source file \"%s\" \n" " %s " msgstr "" -" Nepavyko atverti rinkmenos „%s“ \n" +" Nepavyko atverti failo „%s“ \n" " %s " msgid " Reget failed, about to overwrite file " -msgstr " Atsiuntimas iš naujo nepavyko, bus perrašyta rinkmena " +msgstr " Atsiuntimas iš naujo nepavyko, bus perrašytas failas " #, c-format msgid "" " Cannot fstat source file \"%s\" \n" " %s " msgstr "" -" Nepavyko nustatyti rinkmenos „%s“ būklės („fstat“) \n" +" Nepavyko nustatyti failo „%s“ būklės („fstat“) \n" " %s " #, c-format @@ -1379,7 +1364,7 @@ msgid "" " Cannot create target file \"%s\" \n" " %s " msgstr "" -" Nepavyko atverti paskirties rinkmenos „%s“ \n" +" Nepavyko atverti paskirties failo „%s“ \n" " %s " #, c-format @@ -1387,7 +1372,7 @@ msgid "" " Cannot fstat target file \"%s\" \n" " %s " msgstr "" -" Nepavyko nustatyti paskirties rinkmenos „%s“ būklės („fstat“) \n" +" Nepavyko nustatyti paskirties failo „%s“ būklės („fstat“) \n" " %s " #, c-format @@ -1395,7 +1380,7 @@ msgid "" " Cannot read source file \"%s\" \n" " %s " msgstr "" -" Nepavyko perskaityti rinkmenos „%s“ \n" +" Nepavyko perskaityti failo „%s“ \n" " %s " #, c-format @@ -1403,7 +1388,7 @@ msgid "" " Cannot write target file \"%s\" \n" " %s " msgstr "" -" Nepavyko įrašyti į rinkmeną „%s“ \n" +" Nepavyko įrašyti į failą „%s“ \n" " %s " msgid "(stalled)" @@ -1414,7 +1399,7 @@ msgid "" " Cannot close source file \"%s\" \n" " %s " msgstr "" -" Nepavyko užverti rinkmenos „%s“ \n" +" Nepavyko užverti failo „%s“ \n" " %s " #, c-format @@ -1422,11 +1407,11 @@ msgid "" " Cannot close target file \"%s\" \n" " %s " msgstr "" -" Nepavyko užverti paskirties rinkmenos „%s“ \n" +" Nepavyko užverti paskirties failo „%s“ \n" " %s " msgid "Incomplete file was retrieved. Keep it?" -msgstr "Gauta nepilna rinkmena. Ar ją išlaikyti?" +msgstr "Gautas nepilnas failas. Ar jį išlaikyti?" msgid "&Delete" msgstr "Š&alinti" @@ -1439,7 +1424,7 @@ msgid "" " Cannot stat source directory \"%s\" \n" " %s " msgstr "" -" Nepavyko nustatyti katalogo „%s“ būklės („stat“) \n" +" Nepavyko nustatyti aplanko „%s“ būklės („stat“) \n" " %s " #, c-format @@ -1447,7 +1432,7 @@ msgid "" " Source \"%s\" is not a directory \n" " %s " msgstr "" -" Šaltinis „%s“ nėra katalogas \n" +" Šaltinis „%s“ nėra aplankas \n" " %s " #, c-format @@ -1463,7 +1448,7 @@ msgid "" " Destination \"%s\" must be a directory \n" " %s " msgstr "" -" Paskirtis „%s“ turi būti katalogas \n" +" Paskirtis „%s“ turi būti aplankas \n" " %s " #, c-format @@ -1471,7 +1456,7 @@ msgid "" " Cannot create target directory \"%s\" \n" " %s " msgstr "" -" Nepavyko sukurti paskirties katalogo „%s“ \n" +" Nepavyko sukurti paskirties aplanko „%s“ \n" " %s " #, c-format @@ -1479,7 +1464,7 @@ msgid "" " Cannot chown target directory \"%s\" \n" " %s " msgstr "" -" Nepavyko pakeisti „%s“ nuosavybės \n" +" Nepavyko pakeisti paskirties aplanko „%s“ nuosavybės \n" " %s " #, c-format @@ -1487,19 +1472,19 @@ msgid "" " Cannot stat file \"%s\" \n" " %s " msgstr "" -" Nepavyko patikrinti rinkmenos „%s“ \n" +" Nepavyko patikrinti failo „%s“ \n" " %s " #, c-format msgid " Cannot overwrite directory `%s' " -msgstr " Nepavyko perrašyti katalogo „%s“ " +msgstr " Nepavyko perrašyti aplanko „%s“ " #, c-format msgid "" " Cannot move file \"%s\" to \"%s\" \n" " %s " msgstr "" -" Nepavyko perkelti rinkmenos „%s“ į „%s“ \n" +" Nepavyko perkelti failo „%s“ į „%s“ \n" " %s " #, c-format @@ -1507,21 +1492,21 @@ msgid "" " Cannot remove file \"%s\" \n" " %s " msgstr "" -" Nepavyko pašalinti rinkmenos „%s“ \n" +" Nepavyko pašalinti failo „%s“ \n" " %s " #, c-format msgid " `%s' and `%s' are the same directory " -msgstr " „%s“ ir „%s“ yra tas pats katalogas " +msgstr " „%s“ ir „%s“ yra tas pats aplankas " #, c-format msgid " Cannot overwrite directory \"%s\" %s " -msgstr " Nepavyko perrašyti katalogo „%s“ %s " +msgstr " Nepavyko perrašyti aplanko „%s“ %s " #, c-format msgid " Cannot overwrite file \"%s\" %s " msgstr "" -" Nepavyko perrašyti rinkmenos „%s“ \n" +" Nepavyko perrašyti failo „%s“ \n" " %s " #, c-format @@ -1529,7 +1514,7 @@ msgid "" " Cannot move directory \"%s\" to \"%s\" \n" " %s " msgstr "" -" Nepavyko perkelti katalogo „%s“ į „%s“ \n" +" Nepavyko perkelti aplanko „%s“ į „%s“ \n" " %s " #, c-format @@ -1537,7 +1522,7 @@ msgid "" " Cannot delete file \"%s\" \n" " %s " msgstr "" -" Nepavyko pašalinti rinkmenos „%s“ \n" +" Nepavyko pašalinti failo „%s“ \n" " %s " #, c-format @@ -1545,7 +1530,7 @@ msgid "" " Cannot remove directory \"%s\" \n" " %s " msgstr "" -" Nepavyko pašalinti katalogo „%s“ \n" +" Nepavyko pašalinti aplanko „%s“ \n" " %s " msgid "1Copy" @@ -1566,19 +1551,19 @@ msgid "%o %d %f%m" msgstr "%o %d %f%m" msgid "file" -msgstr "rinkmeną" +msgstr "failą" msgid "files" -msgstr "rinkmenas" +msgstr "failus" msgid "directory" -msgstr "katalogą" +msgstr "aplanką" msgid "directories" -msgstr "katalogus" +msgstr "aplankus" msgid "files/directories" -msgstr "rinkmenas/katalogus" +msgstr "failus/aplankus" msgid " with source mask:" msgstr ", tokiu formatu:" @@ -1604,7 +1589,7 @@ msgid "" " Delete it recursively? " msgstr "" "\n" -" Katalogas netuščias. \n" +" Aplankas netuščias. \n" " Šalinti rekursyviai? " msgid "" @@ -1613,8 +1598,8 @@ msgid "" " Delete it recursively? " msgstr "" "\n" -" Fonini procesas: Katalogas netuščias. \n" -" alinti rekursyviai? " +" Fonini procesas: Aplankas netuščias. \n" +" Šalinti rekursyviai? " msgid " Delete: " msgstr " Šalinti: " @@ -1639,7 +1624,7 @@ msgid "%ld B/s" msgstr "%ld B/s" msgid "File" -msgstr "Rinkmena" +msgstr "Failas" msgid "Count" msgstr "Kiekis" @@ -1658,7 +1643,7 @@ msgstr "Trinama" #, c-format msgid "Target file \"%s\" already exists!" -msgstr "Paskirties rinkmena „%s“ jau yra!" +msgstr "Paskirties failas „%s“ jau yra!" msgid "If &size differs" msgstr "Jei &skiriasi dydis" @@ -1695,10 +1680,10 @@ msgid "Source date: %s, size %u" msgstr "Šaltinio data: %s, dydis %u" msgid " File exists " -msgstr " Rinkmena jau yra " +msgstr " Failas jau yra " msgid " Background process: File exists " -msgstr " Foninis procesas: rinkmena jau yra " +msgstr " Foninis procesas: failas jau yra " msgid "preserve &Attributes" msgstr "Išsaugoti &atributus" @@ -1753,15 +1738,14 @@ msgstr "&Rodyti - F3" msgid "&Edit - F4" msgstr "K&eisti - F4 " -#, fuzzy msgid "&Find recursively" -msgstr "Rasti re&kursyviai" +msgstr "&Rasti rekursyviai" msgid "Start at:" msgstr "Pradėti nuo:" msgid "Filename:" -msgstr "Rinkmenos pavad.:" +msgstr "Failo pavad.:" msgid "Content: " msgstr "Turinys: " @@ -1770,11 +1754,11 @@ msgid "&Tree" msgstr "&Medis" msgid "Find File" -msgstr "Rasti rinkmeną" +msgstr "Rasti failą" #, c-format msgid "Grepping in %s" -msgstr "Ieškoma rinkmenoje %s" +msgstr "Ieškoma faile %s" msgid "Finished" msgstr "Baigta" @@ -1787,14 +1771,14 @@ msgid "Searching" msgstr "Ieškoma" msgid " Help file format error\n" -msgstr " Pagalbos rinkmenos formato klaida\n" +msgstr " Pagalbos failo formato klaida\n" msgid " Internal bug: Double start of link area " msgstr " Vidinė klaida: „Double start of link area“ " #, c-format msgid " Cannot find node %s in help file " -msgstr " Nepavyko rasti „%s“ mazgo pagalbos rinkmenoje " +msgstr " Nepavyko rasti %s mazgo pagalbos faile " msgid "Index" msgstr "Rodyklė" @@ -1839,16 +1823,16 @@ msgid "Subgroup - press ENTER to see list" msgstr "Yra vidinių grupių - ENTER jų sąrašui" msgid "Active VFS directories" -msgstr "Aktyvūs VFS katalogai" +msgstr "Aktyvūs VFS aplankai" msgid "Directory hotlist" -msgstr "Katalogų sąrašas" +msgstr "Aplankų sąrašas" msgid " Directory path " -msgstr " Katalogo kelias " +msgstr " Aplanko kelias " msgid " Directory label " -msgstr " Katalogo žymė " +msgstr " Aplanko žymė " #, c-format msgid "Moving %s" @@ -1858,10 +1842,10 @@ msgid "New hotlist entry" msgstr "Naujas sąrašo punktas" msgid "Directory label" -msgstr "Katalogo žymė" +msgstr "Aplanko žymė" msgid "Directory path" -msgstr "Katalogo kelias" +msgstr "Aplanko kelias" msgid " New hotlist group " msgstr " Nauja sąrašo grupė " @@ -1901,10 +1885,9 @@ msgstr " Aukščiausio lygio grupė " msgid " Hotlist Load " msgstr " Katalogų sąrašo įkėlimas " -#, fuzzy, c-format -msgid "" -"MC was unable to write ~/%s file, your old hotlist entries were not deleted" -msgstr " rinkmenos, seni įrašai išliko" +#, c-format +msgid "MC was unable to write ~/%s file, your old hotlist entries were not deleted" +msgstr "MC nesugebėjo įrašyti ~/%s failo, jūsų seni sąrašai nebuvo ištrinti" #, c-format msgid "Midnight Commander %s" @@ -1912,7 +1895,7 @@ msgstr "Midnight Commander %s" #, c-format msgid "File: %s" -msgstr "Rinkmena: %s" +msgstr "Failas: %s" #, c-format msgid "Free nodes: %d (%d%%) of %d" @@ -1941,7 +1924,7 @@ msgstr "Įtaisas: %s" #, c-format msgid "Filesystem: %s" -msgstr "Rinkmenų sistema: %s" +msgstr "Failų sistema: %s" #, c-format msgid "Accessed: %s" @@ -2021,7 +2004,7 @@ msgid "pe&Rmissions" msgstr "Lei&dimai" msgid "&File types" -msgstr "&Rinkmenų tipai" +msgstr "&Failų tipai" msgid " Panel split " msgstr " Skydų dalijimas " @@ -2107,9 +2090,9 @@ msgid "" " deleted your working directory, or given yourself \n" " extra access permissions with the \"su\" command? " msgstr "" -" Nepavyko įeiti į katalogą, kurį aplinka nurodo kaip \n" -" esamąjį. Galbūt jį ištrynėte arba naudojotės „su“, \n" -" norėdami gauti platesnius leidimus? " +" Nepavyko įeiti į aplanką, kurį aplinka nurodo kaip \n" +" esamąjį. Galbūt jį ištrynėte arba naudojotės „su“ \n" +" komanda, norėdami gauti platesnius leidimus? " msgid " The Midnight Commander " msgstr " Midnight Commander " @@ -2154,7 +2137,7 @@ msgid "&View F3" msgstr "&Rodyti F3" msgid "Vie&w file... " -msgstr "Rodyti &rinkmeną... " +msgstr "Rodyti &failą... " msgid "&Filtered view M-!" msgstr "&Filtruotas vaizdas M-!" @@ -2208,10 +2191,10 @@ msgid "e&Xit F10" msgstr "&Išeiti F10" msgid "&Directory tree" -msgstr "&Katalogų medis" +msgstr "&Aplankų medis" msgid "&Find file M-?" -msgstr "&Rasti rinkmeną M-?" +msgstr "&Rasti failą M-?" msgid "s&Wap panels C-u" msgstr "S&ukeisti skydus C-u" @@ -2220,13 +2203,13 @@ msgid "switch &Panels on/off C-o" msgstr "Įjungti/išj. skydus C-o" msgid "&Compare directories C-x d" -msgstr "Paly&ginti katalogus C-x d" +msgstr "Paly&ginti aplankus C-x d" msgid "e&Xternal panelize C-x !" msgstr "Iš&orinis skydelis C-x !" msgid "show directory s&Izes" -msgstr "Rodyt&i katalogų dydžius" +msgstr "Rodyt&i aplankų dydžius" msgid "command &History" msgstr "Komandų is&torija" @@ -2241,22 +2224,22 @@ msgid "&Background jobs C-x j" msgstr "Foniniai dar&bai C-x j" msgid "&Undelete files (ext2fs only)" -msgstr "Atk&urti rinkmenas (ext2fs)" +msgstr "Atk&urti failus (tik ext2fs)" msgid "&Listing format edit" msgstr "Keisti r&odymo formatą" msgid "Edit &extension file" -msgstr "K&eisti plėtinių rinkmeną" +msgstr "K&eisti plėtinių failą" msgid "Edit &menu file" -msgstr "Keisti &meniu rinkmeną" +msgstr "Keisti &meniu failą" msgid "Edit edi&tor menu file" msgstr "Keisti red. meniu r&inkmeną" msgid "Edit &syntax file" -msgstr "Keisti &sintaksės rinkmeną" +msgstr "Keisti &sintaksės failą" msgid "&Configuration..." msgstr "Konfigūra&cija..." @@ -2274,7 +2257,7 @@ msgid "learn &Keys..." msgstr "Mokyti &klavišų..." msgid "&Virtual FS..." -msgstr "&Virtuali rinkmenų sistema..." +msgstr "&Virtuali failų sistema..." msgid "&Save setup" msgstr "Įrašyti nu&statymus" @@ -2286,7 +2269,7 @@ msgid " &Left " msgstr " &Kairysis skydas " msgid " &File " -msgstr " &Rinkmena " +msgstr " &Failas " msgid " &Command " msgstr " &Komanda " @@ -2309,8 +2292,8 @@ msgid "" " manual reload of the directory. See the man page for \n" " the details. " msgstr "" -" Įjugus greitąjį atnaujinimą, galite matyti netikslų \n" -" katalogo turinį. Tuomet jį atnaujinti reikia rankiniu \n" +" Įjungus greitąjį atnaujinimą, galite matyti netikslų \n" +" aplanko turinį. Tuomet jį atnaujinti reikia rankiniu \n" " būdu - žr. naudotojo vadovą. " msgid "Menu" @@ -2354,8 +2337,7 @@ msgid "" " Menus: menu, menuhot, menusel, menuhotsel\n" " Editor: editnormal, editbold, editmarked\n" " Help: helpnormal, helpitalic, helpbold, helplink, helpslink\n" -" File types: directory, executable, link, stalelink, device, special, " -"core\n" +" File types: directory, executable, link, stalelink, device, special, core\n" "\n" "Colors:\n" " black, gray, red, brightred, green, brightgreen, brown,\n" @@ -2369,14 +2351,13 @@ msgstr "" "\n" "Raktažodžiai:\n" " Globalūs: errors, reverse, gauge, input, viewunderline\n" -" Rinkmenos: normal, selected, marked, markselect\n" +" Failų rodymas: normal, selected, marked, markselect\n" " Dialogai: dnormal, dfocus, dhotnormal, dhotfocus, errdhotnormal,\n" " errdhotfocus\n" " Meniu: menu, menuhot, menusel, menuhotsel\n" " Redaktorius: editnormal, editbold, editmarked\n" " Pagalba: helpnormal, helpitalic, helpbold, helplink, helpslink\n" -" Rinkmenų tipai: directory, executable, link, stalelink, device, special, " -"core\n" +" Failų tipai: directory, executable, link, stalelink, device, special, core\n" "\n" "Spalvos:\n" " black, gray, red, brightred, green, brightgreen, brown,\n" @@ -2421,16 +2402,16 @@ msgid "Displays a help screen on how to change the color scheme" msgstr "Padeda pakeisti spalvų schemą" msgid "Log ftp dialog to specified file" -msgstr "Veda FTP dialogo žurnalą į nurodytą rinkmeną" +msgstr "Veda FTP dialogo žurnalą į nurodytą failą" msgid "Set debug level" msgstr "Nurodo „debug“ lygį" msgid "Print data directory" -msgstr "Parodo duomenų katalogą" +msgstr "Parodo duomenų aplanką" msgid "Print last working directory to specified file" -msgstr "Įrašo paskutinį esamą katalogą į nurodytą rinkmeną" +msgstr "Įrašo paskutinį esamą aplanką į nurodytą failą" msgid "Enables subshell support (default)" msgstr "Įjungia „subshell“ palaikymą (nenurodžius kitaip)" @@ -2439,10 +2420,10 @@ msgid "Disables subshell support" msgstr "Išjungia „subshell“ palaikymą" msgid "Launches the file viewer on a file" -msgstr "Parodo rinkmenos turinį" +msgstr "Parodo failo turinį" msgid "Edits one file" -msgstr "Keičia vieną rinkmeną" +msgstr "Keičia vieną failą" msgid "safe de&Lete" msgstr "Saugus ša&linimas" @@ -2484,7 +2465,7 @@ msgid "&Fast dir reload" msgstr "&Greitai atnaujinti" msgid "mi&X all files" -msgstr "Maišyti visas &rinkmenas" +msgstr "Maišyti visus &failus" msgid "&Drop down menus" msgstr "Išsklei&džiami meniu" @@ -2493,10 +2474,10 @@ msgid "ma&Rk moves down" msgstr "Žymin&t eiti žemyn" msgid "show &Hidden files" -msgstr "Rodyti s&lepiam. rinkmenas" +msgstr "Rodyti s&lepiam. failus" msgid "show &Backup files" -msgstr "R&odyti kopijų rinkmenas" +msgstr "R&odyti ats. kopijų failus" msgid "&Never" msgstr "&Niekada" @@ -2535,7 +2516,7 @@ msgid " Enter command label: " msgstr " Įveskite komandos žymę: " msgid " Cannot run external panelize in a non-local directory " -msgstr " Negalima sudėti į išorinį skydą nevietiniame kataloge " +msgstr " Negalima sudėti į išorinį skydą nevietiniame aplanke " msgid "Find rejects after patching" msgstr "Rasti atmetimus po „patch“" @@ -2632,9 +2613,9 @@ msgstr[2] "%s baitų" #, c-format msgid "%s in %d file" msgid_plural "%s in %d files" -msgstr[0] "%s %d rinkmenoje" -msgstr[1] "%s %d rinkmenose" -msgstr[2] "%s %d rinkmenų" +msgstr[0] "%s %d faile" +msgstr[1] "%s %d failuose" +msgstr[2] "%s %d failų" msgid "" msgstr "<„readlink“ nepavyko>" @@ -2664,7 +2645,7 @@ msgid " Choose input codepage " msgstr " Parinkite įvesties koduotę " msgid "- < No translation >" -msgstr "- < Jokio vertimo >" +msgstr "– < Jokio vertimo >" msgid "" "To use this feature select your codepage in\n" @@ -2713,28 +2694,28 @@ msgid "Using included S-Lang library" msgstr "Naudoti pridėtą S-Lang biblioteką" msgid "with termcap database" -msgstr "su „termcap“ duomenų baze" +msgstr "su termcap duomenų baze" msgid "with terminfo database" -msgstr "su „terminfo“ duomenų baze" +msgstr "su terminfo duomenų baze" msgid "Using the ncurses library" -msgstr "Su „ncurses“ biblioteka" +msgstr "Su ncurses biblioteka" msgid "With optional subshell support" msgstr "Su pasirenkamu „subshell“ palaikymu" msgid "With subshell support as default" -msgstr "Su „subshell“ palaikymu, kitaip nenurodžius" +msgstr "Su „subshell“ palaikymu pagal nutylėjimą" msgid "With support for background operations\n" msgstr "Su fono operacijų galimybe\n" msgid "With mouse support on xterm and Linux console\n" -msgstr "Su pelės palaikymu „xterm“ ir „Linux“ konsolėse\n" +msgstr "Su pelės palaikymu xterm ir Linux konsolėse\n" msgid "With mouse support on xterm\n" -msgstr "Su pelės palaikymu „xterm“\n" +msgstr "Su pelės palaikymu xterm\n" msgid "With support for X11 events\n" msgstr "Su X11 įvykių palaikymu\n" @@ -2747,23 +2728,23 @@ msgstr "Su daugelio koduočių galimybe\n" #, c-format msgid "Virtual File System:" -msgstr "Virtualioji rinkmenų sistema:" +msgstr "Virtualioji failų sistema:" #, c-format msgid "" "Cannot open the %s file for writing:\n" "%s\n" msgstr "" -" Nepavyko atverti rinkmenos „%s“ rašymui:\n" +" Nepavyko atverti failo %s rašymui:\n" "%s\n" #, c-format msgid "Copy \"%s\" directory to:" -msgstr "Kopijuoti katalogą „%s“ į:" +msgstr "Kopijuoti aplanką „%s“ į:" #, c-format msgid "Move \"%s\" directory to:" -msgstr "Perkelti katalogą „%s“ į:" +msgstr "Perkelti aplanką „%s“ į:" #, c-format msgid "" @@ -2775,7 +2756,7 @@ msgstr "" #, c-format msgid " Delete %s? " -msgstr " Šalinti „%s“? " +msgstr " Šalinti %s? " msgid "Static" msgstr "Stat." @@ -2797,19 +2778,19 @@ msgid "" "Cannot write to the %s file:\n" "%s\n" msgstr "" -"Nepavyko įrašyti į rinkmeną „%s“:\n" +"Nepavyko įrašyti į failą %s:\n" "%s\n" msgid " Format error on file Extensions File " -msgstr " Formato klaida rinkmenų plėtinių rinkmenoje" +msgstr " Formato klaida failų plėtinių faile" #, c-format msgid " The %%var macro has no default " -msgstr " „%%var“ makrosas neturi pradmens " +msgstr " %%var makrokomanda neturi pradmens " #, c-format msgid " The %%var macro has no variable " -msgstr " „%%var“ makrosas neturi kintamojo " +msgstr " %%var makrokomanda neturi kintamojo " msgid " Debug " msgstr " „Debug“ " @@ -2824,15 +2805,15 @@ msgid " False: " msgstr " Melas: " msgid " Warning -- ignoring file " -msgstr " Įspėjimas -- rinkmena ignoruojama " +msgstr " Įspėjimas -- failas ignoruojamas " #, c-format msgid "" "File %s is not owned by root or you or is world writable.\n" "Using it may compromise your security" msgstr "" -"Rinkmena „%s“ nepriklauso „root“ ar jums arba visi gali į ją rašyti.\n" -"Jos naudojimas gali būti nesaugus" +"Failas %s nepriklauso nei „root“, nei jums arba visi gali į ją rašyti.\n" +"Jo naudojimas gali būti nesaugus" #, c-format msgid " No suitable entries found in %s " @@ -2848,31 +2829,31 @@ msgid "%b %e %Y" msgstr "%b %e %Y" msgid "(invalid)" -msgstr "" +msgstr "(negalioja)" #, c-format msgid "%s is not a directory\n" -msgstr "„%s“ nėra katalogas\n" +msgstr "%s nėra aplankas\n" #, c-format msgid "Directory %s is not owned by you\n" -msgstr "Katalogas „%s“ nepriklauso jums\n" +msgstr "Aplankas %s jums nepriklauso\n" #, c-format msgid "Cannot set correct permissions for directory %s\n" -msgstr " Nepavyko nustatyti reikiamų teisių katalogui „%s“\n" +msgstr " Nepavyko nustatyti reikiamų teisių aplankui %s\n" #, c-format msgid "Cannot create temporary directory %s: %s\n" -msgstr "Nepavyko sukurti laikino katalogo „%s“: %s\n" +msgstr "Nepavyko sukurti laikino aplanko %s: %s\n" #, c-format msgid "Temporary files will be created in %s\n" -msgstr "Laikinosios rinkmenos bus talpinamos kataloge „%s“\n" +msgstr "Laikinieji failai bus talpinami aplanke %s\n" #, c-format msgid "Temporary files will not be created\n" -msgstr "Laikinosios rinkmenos nebus kuriamos\n" +msgstr "Laikinieji failai nebus kuriami\n" msgid " Pipe failed " msgstr " Konvejeris nepavyko " @@ -2903,11 +2884,11 @@ msgstr "" " %s " msgid " Cannot view: not a regular file " -msgstr " Nepavyko parodyti: rinkmena nėra įprastinė " +msgstr " Nepavyko parodyti: failas nėra įprastinis " #, c-format msgid "File: %s" -msgstr "Rinkmena: %s" +msgstr "Failas: %s" #, c-format msgid "Offset 0x%08lx" @@ -2931,7 +2912,7 @@ msgid "" " %s \n" " Data may have been written or not. " msgstr "" -" Klaida uždarant rinkmeną: \n" +" Klaida uždarant failą: \n" " %s \n" " Duomenys galėjo būti neįrašyti. " @@ -2940,7 +2921,7 @@ msgid "" " Cannot save file: \n" " %s " msgstr "" -" Nepavyko įrašyti rinkmenos: \n" +" Nepavyko įrašyti failo: \n" " %s " msgid "Invalid hex search expression" @@ -2968,9 +2949,8 @@ msgstr "" msgid " Goto Address " msgstr " Eiti adresu " -#, fuzzy msgid " Invalid address " -msgstr " Neteisingas slaptažodis " +msgstr " Neteisingas adresas " msgid " Enter regexp:" msgstr " Įveskite reguliarą išraišką: " @@ -3210,26 +3190,26 @@ msgid "" "in cpio archive\n" "%s" msgstr "" -"Nesutampantys „hardlinks“:\n" +"Nesutampančios nuorodos:\n" "%s\n" "„cpio“ archyve\n" "%s" #, c-format msgid "%s contains duplicate entries! Skipping!" -msgstr "Rinkmenoje „%s“ yra dvigubų įrašų! Praleidžiu." +msgstr "Faile „%s“ turi dvigubų įrašų! Praleidžiama!" #, c-format msgid "" "Unexpected end of file\n" "%s" msgstr "" -"Netikėta rinkmenos pabaiga\n" +"Netikėta failo pabaiga\n" "%s" #, c-format msgid "Directory cache expired for %s" -msgstr "Katalogo „%s“ kešas nebegalioja" +msgstr "Aplanko „%s“ podėlis nebegalioja" msgid "Starting linear transfer..." msgstr "Pradedamas siuntimas..." @@ -3243,7 +3223,7 @@ msgid "%s: %s: %s %lu bytes transferred" msgstr "%s: %s: %s %lu baitų persiųsta" msgid "Getting file" -msgstr "Parsiunčiama rinkmena" +msgstr "Parsiunčiamas failas" #, c-format msgid "" @@ -3279,7 +3259,7 @@ msgid "fish: Handshaking version..." msgstr "fish: derinamos versijos..." msgid "fish: Setting up current directory..." -msgstr "fish: nustatomas esamas katalogas..." +msgstr "fish: nustatomas esamas aplankas..." #, c-format msgid "fish: Connected, home %s." @@ -3287,7 +3267,7 @@ msgstr "fish: prisijungta, namai %s. " #, c-format msgid "fish: Reading directory %s..." -msgstr "fish: atveriamas katalogas %s..." +msgstr "fish: atveriamas aplankas %s..." #, c-format msgid "%s: done." @@ -3395,7 +3375,7 @@ msgstr "Sprendžiama simb. nuoroda..." #, c-format msgid "ftpfs: Reading FTP directory %s... %s%s" -msgstr "ftpfs: atveriamas FTP katalogas %s... %s%s" +msgstr "ftpfs: atveriamas FTP aplankas %s... %s%s" msgid "(strict rfc959)" msgstr "(griežtas rfc959)" @@ -3408,7 +3388,7 @@ msgstr "ftpfs: nepavyko; nėra kur grįžti" #, c-format msgid "ftpfs: storing file %lu (%lu)" -msgstr "ftpfs: siunčiama rinkmena %lu (%lu)" +msgstr "ftpfs: siunčiamas failas %lu (%lu)" msgid "" "~/.netrc file has incorrect mode.\n" @@ -3458,7 +3438,7 @@ msgid "" "Warning: Invalid line in %s:\n" "%s\n" msgstr "" -"Įspėjimas: klaidinga eilutė rinkmenoje „%s“:\n" +"Įspėjimas: klaidinga eilutė faile %s:\n" "%s\n" #, c-format @@ -3466,7 +3446,7 @@ msgid "" "Warning: Invalid flag %c in %s:\n" "%s\n" msgstr "" -"Įspėjimas: klaidingas parametras „%c“ rinkmenoje „%s“:\n" +"Įspėjimas: klaidingas parametras %c faile %s:\n" "%s\n" #, c-format @@ -3482,37 +3462,37 @@ msgstr " Autentifikacija nepavyko " #, c-format msgid " Error %s creating directory %s " -msgstr " Klaida „%s“ kuriant katalogą „%s“ " +msgstr " Klaida „%s“ kuriant aplanką „%s“ " #, c-format msgid " Error %s removing directory %s " -msgstr " Klaida „%s“ šalinant katalogą „%s“ " +msgstr " Klaida „%s“ šalinant aplanką „%s“ " #, c-format msgid " %s opening remote file %s " -msgstr " „%s“ atveriant rinkmeną „%s“ " +msgstr " %s atveriant nutolusį failą %s " #, c-format msgid " %s removing remote file %s " -msgstr " „%s“ šalinant rinkmeną „%s“ " +msgstr " %s šalinant nutolusį failą %s " #, c-format msgid " %s renaming files\n" -msgstr " „%s“ pervadinamos rinkmenos\n" +msgstr " %s pervadinant failus\n" #, c-format msgid "" "Cannot open tar archive\n" "%s" msgstr "" -"Nepvyko atverti „tar“ archyvo\n" +"Nepavyko atverti tar archyvo\n" "%s" msgid "Inconsistent tar archive" -msgstr "Prieštaringas „tar“ archyvas" +msgstr "Nevientisas tar archyvas" msgid "Unexpected EOF on archive file" -msgstr "Netikėta archyvo rinkmenos pabaiga" +msgstr "Netikėta archyvo failo pabaiga" #, c-format msgid "" @@ -3522,7 +3502,7 @@ msgid "" msgstr "" "Hmm,...\n" "%s\n" -"nepanašu į „tar“ archyvą." +"nepanašus į „tar“ archyvą." msgid " undelfs: error " msgstr " undelfs: klaida " @@ -3543,7 +3523,7 @@ msgstr " pradedant %d „inode“ skenavimą " #, c-format msgid "undelfs: loading deleted files information %d inodes" -msgstr "undelfs: įkeliama pašalintų rinkmenų informacija (%d „inodes“)" +msgstr "undelfs: įkeliama pašalintų failų informacija (%d „inodes“)" #, c-format msgid " while calling ext2_block_iterate %d " @@ -3561,7 +3541,7 @@ msgstr " „Ext2lib“ klaida " #, c-format msgid " Cannot open file %s " -msgstr " Nepavyko atverti rinkmenos %s " +msgstr " Nepavyko atverti failo %s " msgid "undelfs: reading inode bitmap..." msgstr "undelfs: skaitomas bloko bitų laukas..." @@ -3586,7 +3566,7 @@ msgstr "" " %s \n" msgid " vfs_info is not fs! " -msgstr " „vfs_info“ nėra rinkmenų sistema! " +msgstr " vfs_info nėra failų sistema! " msgid " You have to chdir to extract files first " msgstr " Reikia pakeisti katalogą, norint išpakuoti " @@ -3604,35 +3584,26 @@ msgid "Internal error:" msgstr "Vidinė klaida:" msgid "Changes to file lost" -msgstr "Rinkmenos pakeitimai prarasti" +msgstr "Failo pakeitimai prarasti" #~ msgid "&Home" #~ msgstr "&Namų" - #~ msgid "&Type" #~ msgstr "&Tipas" - #~ msgid "&Links" #~ msgstr "&Nuorodos" - #~ msgid "N&GID" #~ msgstr "N&GID" - #~ msgid "N&UID" #~ msgstr "N&UID" - #~ msgid "&Owner" #~ msgstr "&Savin." - #~ msgid "&Group" #~ msgstr "&Grupė" - #~ msgid "MC was unable to write ~/" #~ msgstr "Nepavyko įrašyti ~/" - #~ msgid " Notice " #~ msgstr " Pastaba " - #~ msgid "" #~ " The Midnight Commander configuration files \n" #~ " are now stored in the ~/.mc directory, the \n" @@ -3640,3 +3611,4 @@ msgstr "Rinkmenos pakeitimai prarasti" #~ msgstr "" #~ " „Midnight Commander“ savo nustatymus laiko \n" #~ " „~/.mc“ kataloge, rinkmenos perkeltos į jį.\n" +