mirror of https://github.com/MidnightCommander/mc
Merge branch 'mc-4.6' into 147_escaping
* mc-4.6: replaced buggy concat_dir_and_file() by mhl_str_dir_plus_file() fixed out-of-tree-builds Updated the NEWS file for 4.6.2 and added the bugnumbers behind the items in the list. Update for OpenOffice and StarOffice viewer. changelog: added entry for python syntax syntax: python: keywords update (patch by NNemec) fixes #216 AC_USE_SYSTEM_EXTENSIONS macro requires autoconf >= 2.60 po/ru.po: In russian translation, there are some hotkey conficts in menu. ChangeLog/NEWS: added entry for #181 ticket (copy to deleted dir) Now a trailing slash will only be added in copy & move dialogs if the path itselfs copy/move dialog: add trailing '/' to default destination path (fix #181) fixed comments to /* ... */ Not only comment it out but removing it Removed unneeded var to make build process a bit cleaner Add code snipplet by il.smind which should fix issues with putty and Conflicts: ChangeLog mhl/string.h src/command.c src/complete.c src/file.c src/util.c
This commit is contained in:
commit
ff4de3d66f
28
ChangeLog
28
ChangeLog
|
@ -6,11 +6,39 @@
|
|||
* 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 <weigelt@metux.de>
|
||||
|
||||
* replaced buggy concat_dir_and_file() by mhl_str_dir_plus_file() (in mhl/string.h)
|
||||
|
||||
2009-01-30 Enrico Weigelt, metux ITS <weigelt@metux.de>
|
||||
|
||||
* src/Makefile.am, edit/Makefile.am vfs/Makefile.am: fixed #208
|
||||
(out-of-tree builds)
|
||||
|
||||
2009-01-29 Mikhail S. Pobolovets <styx.mp@gmail.com>
|
||||
* lib/mc.ext.in: update for OpenOffice and StarOffice viewer.
|
||||
odt2txt is now used
|
||||
|
||||
2009-01-29 Patrick Winnertz <winnie@debian.org> & Sergei Trofimovich <slyfox@inbox.ru>
|
||||
|
||||
* src/file.c: Added trailing dir separator for default path in copy/move dialogs.
|
||||
This solves "strange" rename cases, when copying/moving is performed into
|
||||
deleted directory.
|
||||
|
||||
2009-01-27 Enrico Weigelt, metux ITS <weigelt@metux.de>
|
||||
|
||||
* 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 <weigelt@metux.de>
|
||||
|
||||
* mhl/escape.h, mhl/string.h: fixed comments to use /* ... */
|
||||
|
||||
2009-01-27 Sergei Trofimovich <slyfox@inbox.ru>
|
||||
|
||||
* syntax/python.syntax: Added syntax highlighting for
|
||||
pytnoh-2.6+ keywords (patch sent by NNemec)
|
||||
|
||||
2009-01-25 Ilia Maslakov <il.smind@gmail.com>
|
||||
|
||||
* src/boxes.c, src/boxes.h, src/dir.c, src/dir.h:
|
||||
|
|
49
NEWS
49
NEWS
|
@ -2,41 +2,46 @@ Version 4.6.2
|
|||
|
||||
- MC Core
|
||||
- Changed HQ url to point to new website
|
||||
www.midnight-commander.org
|
||||
www.midnight-commander.org (Closes: #137, #138)
|
||||
- Added a micro helper library in order to go slowly
|
||||
avay from glib
|
||||
avay from glib (Closes: #157)
|
||||
- Use static strings as section entries in ~/.mc/history
|
||||
WARNING!: This will break old files
|
||||
WARNING!: This will break old files (Closes: #50)
|
||||
- Fixed a repaint issue when clicking on the "View" Button instead
|
||||
of using F3
|
||||
- Removed obsolete autoconf macros
|
||||
- Fix escaping for command line completion
|
||||
- prevend mc from segfaulting when getting invalid timestamps on files
|
||||
- Fixed a keybord issue when running mc via a putty console
|
||||
- setted pty fd to closeonexec (on subshell)
|
||||
of using F3 (Closes: #35)
|
||||
- Removed obsolete autoconf macros (Closes: #133)
|
||||
- Fix escaping for command line completion (Closes: #147)
|
||||
- prevent mc from segfaulting when getting invalid timestamps on files (Closes: #96)
|
||||
- Fixed a keybord issue when running mc via a putty console (Closes: #203)
|
||||
- setted pty fd to closeonexec (on subshell) (Closes: #174)
|
||||
- Fixed file renames, when copying/moving is performed
|
||||
into deleted directories. (Closes: #181)
|
||||
- Add an option to show executables first in the panels (Closes: #173)
|
||||
|
||||
- Editor
|
||||
- Syntax highlighting for:
|
||||
+ debian files (debian/changelog, debian/control, debian/copyright, ..)
|
||||
+ updated sh syntax highlighting
|
||||
+ updated pascal syntax highlighting
|
||||
+ differentiate between c and cpp files for highlighting
|
||||
- Removed some unneeded variables
|
||||
- Do use a ro test if a file exists
|
||||
- Fixes some missbehaviour in regex matching
|
||||
+ debian files (debian/changelog, debian/control, debian/copyright, ..) (Closes: #142)
|
||||
+ updated sh syntax highlighting (Closes: #143)
|
||||
+ updated pascal syntax highlighting (Closes: #65)
|
||||
+ differentiate between c and cpp files for highlighting (Closes: #16)
|
||||
+ updated python highlighting to support python 2.6 (Closes: #216)
|
||||
- Removed some unneeded variables (Closes: #168, #151)
|
||||
- Do use a ro test if a file exists (Closes: #206)
|
||||
- Fixes some missbehaviour in regex matching (Closes: #207, #211 )
|
||||
+ start at front of line and not on cursor position
|
||||
+ . shouldn't match a newline
|
||||
|
||||
- VFS
|
||||
- Fix some bashisms in some extfs scripts
|
||||
- Fix some bashisms in some extfs scripts (Closes: #146)
|
||||
- Fixed various problems with symlinks and files with chars which needs
|
||||
escaping over fish
|
||||
- Added 7zip extfs descriptor
|
||||
escaping over fish (Closes: #10, #87, #149)
|
||||
- Added 7zip extfs descriptor (Closes: #92)
|
||||
- Switched from o3totxt to odf2txt as o3totxt is outdated (Closes: #218)
|
||||
|
||||
- Locale
|
||||
- Updated german translation
|
||||
- New Belarussian translation
|
||||
- Updated russian translation
|
||||
- Updated german translation (Closes: #167)
|
||||
- New Belarussian translation (Closes: #170)
|
||||
- Updated russian translation (Closes: #159)
|
||||
|
||||
Version 4.6.2-pre1.
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ dnl Configure.in file for the Midnight Commander
|
|||
dnl
|
||||
|
||||
AC_INIT([GNU Midnight Commander], [], [mc-devel@gnome.org])
|
||||
AC_PREREQ(2.54)
|
||||
AC_PREREQ(2.60)
|
||||
m4_pattern_forbid(MC_)
|
||||
AC_CONFIG_SRCDIR(src/main.c)
|
||||
AC_CONFIG_AUX_DIR(config)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
AM_CFLAGS = $(GLIB_CFLAGS)
|
||||
AM_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
|
||||
|
||||
if USE_EDIT
|
||||
noinst_LIBRARIES = libedit.a
|
||||
|
|
|
@ -30,9 +30,10 @@
|
|||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "../src/global.h"
|
||||
|
||||
#include "edit.h"
|
||||
|
@ -2665,7 +2666,7 @@ user_menu (WEdit * edit)
|
|||
int nomark;
|
||||
struct stat status;
|
||||
long start_mark, end_mark;
|
||||
char *block_file = concat_dir_and_file (home_dir, BLOCK_FILE);
|
||||
char *block_file = mhl_str_dir_plus_file (home_dir, BLOCK_FILE);
|
||||
int rc = 0;
|
||||
|
||||
nomark = eval_marks (edit, &start_mark, &end_mark);
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/types.h>
|
||||
|
@ -36,9 +35,10 @@
|
|||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#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 = concat_dir_and_file (edit->dir, filename);
|
||||
savename = mhl_str_dir_plus_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 = concat_dir_and_file (savedir, "cooledit");
|
||||
saveprefix = mhl_str_dir_plus_file (savedir, "cooledit");
|
||||
g_free (savedir);
|
||||
fd = mc_mkstemps (&savename, saveprefix, NULL);
|
||||
g_free (saveprefix);
|
||||
|
|
|
@ -33,9 +33,10 @@
|
|||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "../src/global.h"
|
||||
|
||||
#include "edit.h"
|
||||
|
@ -174,7 +175,7 @@ edit_file (const char *_file, int line)
|
|||
WButtonBar *edit_bar;
|
||||
|
||||
if (!made_directory) {
|
||||
char *dir = concat_dir_and_file (home_dir, EDIT_DIR);
|
||||
char *dir = mhl_str_dir_plus_file (home_dir, EDIT_DIR);
|
||||
made_directory = (mkdir (dir, 0700) != -1 || errno == EEXIST);
|
||||
g_free (dir);
|
||||
}
|
||||
|
|
|
@ -30,9 +30,10 @@
|
|||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "../src/global.h"
|
||||
|
||||
#include "edit.h"
|
||||
|
@ -1026,7 +1027,7 @@ edit_read_syntax_file (WEdit * edit, char ***pnames, const char *syntax_file,
|
|||
|
||||
f = fopen (syntax_file, "r");
|
||||
if (!f){
|
||||
lib_file = concat_dir_and_file (mc_home, "syntax" PATH_SEP_STR "Syntax");
|
||||
lib_file = mhl_str_dir_plus_file (mc_home, "syntax" PATH_SEP_STR "Syntax");
|
||||
f = fopen (lib_file, "r");
|
||||
g_free (lib_file);
|
||||
if (!f)
|
||||
|
@ -1188,7 +1189,7 @@ edit_load_syntax (WEdit *edit, char ***pnames, const char *type)
|
|||
if (!*edit->filename && !type)
|
||||
return;
|
||||
}
|
||||
f = concat_dir_and_file (home_dir, SYNTAX_FILE);
|
||||
f = mhl_str_dir_plus_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) {
|
||||
|
|
|
@ -26,11 +26,12 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "../src/global.h"
|
||||
|
||||
#include "edit.h"
|
||||
|
@ -596,7 +597,7 @@ edit_load_user_map(WEdit *edit)
|
|||
if (edit_key_emulation != EDIT_KEY_EMULATION_USER)
|
||||
return TRUE;
|
||||
|
||||
file = concat_dir_and_file(home_dir, MC_USERMAP);
|
||||
file = mhl_str_dir_plus_file(home_dir, MC_USERMAP);
|
||||
|
||||
if (stat(file, &s) < 0) {
|
||||
char *msg = g_strdup_printf(_("%s not found!"), file);
|
||||
|
|
|
@ -445,7 +445,7 @@ shell/.sdw
|
|||
# StarOffice 6 and OpenOffice.org formats
|
||||
regex/\.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$
|
||||
Open=(ooffice %f &)
|
||||
View=%view{ascii} unzip -p %f content.xml | o3totxt
|
||||
View=%view{ascii} odt2txt %f
|
||||
|
||||
# AbiWord
|
||||
shell/.abw
|
||||
|
|
|
@ -74,12 +74,12 @@ 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
|
||||
/* 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 '\'
|
||||
/* if we're here, we're standing on the first '\' */
|
||||
char* writeptr = readptr;
|
||||
char c;
|
||||
while ((c = *readptr))
|
||||
|
@ -117,7 +117,7 @@ static inline char* mhl_shell_unescape_buf(char* text)
|
|||
(*writeptr) = c; writeptr++; break;
|
||||
}
|
||||
}
|
||||
else // got a normal character
|
||||
else /* got a normal character */
|
||||
{
|
||||
(*writeptr) = *readptr;
|
||||
writeptr++;
|
||||
|
|
62
mhl/string.h
62
mhl/string.h
|
@ -17,30 +17,29 @@ static inline char * mhl_str_dup_range(const char * s_start, const char * s_boun
|
|||
|
||||
static inline char* mhl_str_trim(char* str)
|
||||
{
|
||||
if (!str) return NULL; // NULL string ?! bail out.
|
||||
if (!str) return NULL; /* NULL string ?! bail out. */
|
||||
|
||||
// find the first non-space
|
||||
/* find the first non-space */
|
||||
char* start; for (start=str; ((*str) && (!isspace(*str))); str++);
|
||||
|
||||
// only spaces ?
|
||||
/* only spaces ? */
|
||||
if (!(*str)) { *str = 0; return str; }
|
||||
|
||||
// get the size (cannot be empty - catched above)
|
||||
/* get the size (cannot be empty - catched above) */
|
||||
size_t _sz = strlen(str);
|
||||
|
||||
// find the proper end
|
||||
/* find the proper end */
|
||||
char* end;
|
||||
for (end=(str+_sz-1); ((end>str) && (isspace(*end))); end--);
|
||||
end[1] = 0; // terminate, just to be sure
|
||||
end[1] = 0; /* terminate, just to be sure */
|
||||
|
||||
// if we have no leading spaces, just trucate
|
||||
/* 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 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
|
||||
/* by here we have a (non-empty) region between start end end */
|
||||
memmove(str,start,(end-start+1));
|
||||
return str;
|
||||
}
|
||||
|
@ -71,10 +70,9 @@ static inline char* __mhl_str_concat_hlp(const char* base, ...)
|
|||
va_list args;
|
||||
va_start(args,base);
|
||||
char* a;
|
||||
// note: we use ((char*)(1)) as terminator - NULL is a valid argument !
|
||||
/* note: we use ((char*)(1)) as terminator - NULL is a valid argument ! */
|
||||
while ((a = va_arg(args, char*))!=(char*)1)
|
||||
{
|
||||
// printf("a=%u\n", a);
|
||||
if (a)
|
||||
{
|
||||
arg_ptr[count] = a;
|
||||
|
@ -87,7 +85,7 @@ static inline char* __mhl_str_concat_hlp(const char* base, ...)
|
|||
if (!count)
|
||||
return mhl_str_dup("");
|
||||
|
||||
// now as we know how much to copy, allocate the buffer
|
||||
/* 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;
|
||||
|
@ -105,8 +103,8 @@ static inline char* __mhl_str_concat_hlp(const char* base, ...)
|
|||
|
||||
static inline char* mhl_str_reverse(char* ptr)
|
||||
{
|
||||
if (!ptr) return NULL; // missing string
|
||||
if (!(ptr[0] && ptr[1])) return ptr; // empty or 1-ch string
|
||||
if (!ptr) return NULL; /* missing string */
|
||||
if (!(ptr[0] && ptr[1])) return ptr; /* empty or 1-ch string */
|
||||
|
||||
size_t _sz = strlen(ptr);
|
||||
char* start = ptr;
|
||||
|
@ -136,4 +134,38 @@ static inline char * mhl_strmove(char * dest, const char * src)
|
|||
|
||||
return memmove(dest, src, n);
|
||||
}
|
||||
|
||||
static inline char* mhl_str_dir_plus_file(const char* dirname, const char* filename)
|
||||
{
|
||||
/* make sure we have valid strings */
|
||||
if (!dirname)
|
||||
dirname="";
|
||||
|
||||
if (!filename)
|
||||
filename="";
|
||||
|
||||
/* skip leading slashes on filename */
|
||||
while (*filename == '/')
|
||||
filename++;
|
||||
|
||||
/* skip trailing slashes on dirname */
|
||||
int dnlen = strlen(dirname);
|
||||
while (dnlen && (dirname[dnlen-1]=='/'))
|
||||
dnlen--;
|
||||
|
||||
int fnlen = strlen(filename);
|
||||
char* buffer = mhl_mem_alloc_z(dnlen+fnlen+2); /* enough space for dirname, /, filename, zero */
|
||||
char* ptr = buffer;
|
||||
|
||||
memcpy(ptr, dirname, dnlen);
|
||||
ptr+=dnlen;
|
||||
*ptr = '/';
|
||||
ptr++;
|
||||
memcpy(ptr, filename, fnlen);
|
||||
ptr+=fnlen;
|
||||
*ptr = 0;
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
#endif /* __MHL_STRING_H */
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2009-01-10 Andrew Borodin <aborodin@vmail.ru>
|
||||
|
||||
* ru.po: Fix conflicting shortcuts in the russian translation.
|
||||
|
||||
2008-06-30 David Martin <dmartina@excite.com>
|
||||
|
||||
* es.po: Updated Spanish translation. Converted to UTF-8.
|
||||
|
|
10
po/ru.po
10
po/ru.po
|
@ -423,7 +423,7 @@ msgid "&Insert file... F15"
|
|||
msgstr "&饔粤咨载 屏侍... F15"
|
||||
|
||||
msgid "Copy to &file... C-f"
|
||||
msgstr "&Копировать в файл... C-f"
|
||||
msgstr "Ко&пировать в файл... C-f"
|
||||
|
||||
msgid "&User menu... F11"
|
||||
msgstr "&砼卫 邢特谙琢耘萄... F11"
|
||||
|
@ -513,7 +513,7 @@ msgid "Sor&t... M-t"
|
|||
msgstr "&笙以梢献肆... M-t"
|
||||
|
||||
msgid "Paste o&utput of... M-u"
|
||||
msgstr "Вставить вывод &команды... M-u"
|
||||
msgstr "Вставить в&ывод команды... M-u"
|
||||
|
||||
msgid "E&xternal Formatter F19"
|
||||
msgstr "&嫦彝猎梢献廖膳 F19"
|
||||
|
@ -540,7 +540,7 @@ msgid "Syntax &Highlighting..."
|
|||
msgstr "&阕旁献倌盘盼膳 由卧了由恿..."
|
||||
|
||||
msgid "Save setu&p..."
|
||||
msgstr "&Сохранить настройки"
|
||||
msgstr "Со&хранить настройки"
|
||||
|
||||
msgid " File "
|
||||
msgstr " 媪侍 "
|
||||
|
@ -2165,7 +2165,7 @@ msgid "Vie&w file... "
|
|||
msgstr "&鹨嫌拖砸 屏侍<E5B18F>..."
|
||||
|
||||
msgid "&Filtered view M-!"
|
||||
msgstr "&Просмотр команды M-!"
|
||||
msgstr "Просмотр команд&ы M-!"
|
||||
|
||||
msgid "&Edit F4"
|
||||
msgstr "&蚺牧嗽梢献廖膳 F4"
|
||||
|
@ -2264,7 +2264,7 @@ msgid "Edit edi&tor menu file"
|
|||
msgstr "鹨磷肆 团卫 <20>&拍了韵伊"
|
||||
|
||||
msgid "Edit &syntax file"
|
||||
msgstr "Файл синтаксиса"
|
||||
msgstr "Фа&йл синтаксиса"
|
||||
|
||||
msgid "&Configuration..."
|
||||
msgstr "&胂纹汕找撩裳..."
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
AM_CFLAGS = $(GLIB_CFLAGS)
|
||||
AM_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
|
||||
|
||||
localedir = $(datadir)/locale
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
|
|
|
@ -48,7 +48,7 @@ load_codepages_list (void)
|
|||
extern int display_codepage;
|
||||
char *default_codepage = NULL;
|
||||
|
||||
fname = concat_dir_and_file (mc_home, CHARSETS_INDEX);
|
||||
fname = mhl_str_dir_plus_file (mc_home, CHARSETS_INDEX);
|
||||
if (!(f = fopen (fname, "r"))) {
|
||||
fprintf (stderr, _("Warning: file %s not found\n"), fname);
|
||||
g_free (fname);
|
||||
|
|
26
src/cmd.c
26
src/cmd.c
|
@ -34,6 +34,8 @@
|
|||
#endif
|
||||
#include <unistd.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "cmd.h" /* Our definitions */
|
||||
#include "fileopctx.h" /* file_op_context_new() */
|
||||
|
@ -362,7 +364,7 @@ mkdir_cmd (void)
|
|||
if (dir[0] == '/' || dir[0] == '~')
|
||||
absdir = g_strdup (dir);
|
||||
else
|
||||
absdir = concat_dir_and_file (current_panel->cwd, dir);
|
||||
absdir = mhl_str_dir_plus_file (current_panel->cwd, dir);
|
||||
|
||||
save_cwds_stat ();
|
||||
if (my_mkdir (absdir, 0777) == 0) {
|
||||
|
@ -568,10 +570,10 @@ void ext_cmd (void)
|
|||
_(" Which extension file you want to edit? "), 0, 2,
|
||||
_("&User"), _("&System Wide"));
|
||||
}
|
||||
extdir = concat_dir_and_file (mc_home, MC_LIB_EXT);
|
||||
extdir = mhl_str_dir_plus_file (mc_home, MC_LIB_EXT);
|
||||
|
||||
if (dir == 0){
|
||||
buffer = concat_dir_and_file (home_dir, MC_USER_EXT);
|
||||
buffer = mhl_str_dir_plus_file (home_dir, MC_USER_EXT);
|
||||
check_for_default (extdir, buffer);
|
||||
do_edit (buffer);
|
||||
g_free (buffer);
|
||||
|
@ -598,7 +600,7 @@ menu_edit_cmd (int where)
|
|||
_("&Local"), _("&User"), _("&System Wide")
|
||||
);
|
||||
|
||||
menufile = concat_dir_and_file (mc_home, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
|
||||
menufile = mhl_str_dir_plus_file (mc_home, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
|
||||
|
||||
switch (dir) {
|
||||
case 0:
|
||||
|
@ -607,12 +609,12 @@ menu_edit_cmd (int where)
|
|||
break;
|
||||
|
||||
case 1:
|
||||
buffer = concat_dir_and_file (home_dir, where ? CEDIT_HOME_MENU : MC_HOME_MENU);
|
||||
buffer = mhl_str_dir_plus_file (home_dir, where ? CEDIT_HOME_MENU : MC_HOME_MENU);
|
||||
check_for_default (menufile, buffer);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
buffer = concat_dir_and_file (mc_home, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
|
||||
buffer = mhl_str_dir_plus_file (mc_home, where ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -671,10 +673,10 @@ edit_syntax_cmd (void)
|
|||
_(" Which syntax file you want to edit? "), 0, 2,
|
||||
_("&User"), _("&System Wide"));
|
||||
}
|
||||
extdir = concat_dir_and_file (mc_home, "syntax" PATH_SEP_STR "Syntax");
|
||||
extdir = mhl_str_dir_plus_file (mc_home, "syntax" PATH_SEP_STR "Syntax");
|
||||
|
||||
if (dir == 0) {
|
||||
buffer = concat_dir_and_file (home_dir, SYNTAX_FILE);
|
||||
buffer = mhl_str_dir_plus_file (home_dir, SYNTAX_FILE);
|
||||
check_for_default (extdir, buffer);
|
||||
do_edit (buffer);
|
||||
g_free (buffer);
|
||||
|
@ -805,8 +807,8 @@ compare_dir (WPanel *panel, WPanel *other, enum CompareMode mode)
|
|||
}
|
||||
|
||||
/* Thorough compare on, do byte-by-byte comparison */
|
||||
src_name = concat_dir_and_file (panel->cwd, source->fname);
|
||||
dst_name = concat_dir_and_file (other->cwd, target->fname);
|
||||
src_name = mhl_str_dir_plus_file (panel->cwd, source->fname);
|
||||
dst_name = mhl_str_dir_plus_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);
|
||||
|
@ -920,10 +922,10 @@ do_link (int symbolic_link, const char *fname)
|
|||
char *d;
|
||||
|
||||
/* suggest the full path for symlink */
|
||||
s = concat_dir_and_file (current_panel->cwd, fname);
|
||||
s = mhl_str_dir_plus_file (current_panel->cwd, fname);
|
||||
|
||||
if (get_other_type () == view_listing) {
|
||||
d = concat_dir_and_file (other_panel->cwd, fname);
|
||||
d = mhl_str_dir_plus_file (other_panel->cwd, fname);
|
||||
} else {
|
||||
d = g_strdup (fname);
|
||||
}
|
||||
|
|
|
@ -27,8 +27,9 @@
|
|||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "mhl/memory.h"
|
||||
#include "mhl/escape.h"
|
||||
#include <mhl/memory.h>
|
||||
#include <mhl/escape.h>
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "global.h" /* home_dir */
|
||||
#include "tty.h"
|
||||
|
@ -127,7 +128,7 @@ examine_cd (char *path)
|
|||
c = *s;
|
||||
*s = 0;
|
||||
if (*p) {
|
||||
r = concat_dir_and_file (p, q);
|
||||
r = mhl_str_dir_plus_file (p, q);
|
||||
result = do_cd (r, cd_parse_command);
|
||||
g_free (r);
|
||||
}
|
||||
|
@ -180,7 +181,7 @@ void do_cd_command (char *cmd)
|
|||
} else {
|
||||
char *old = current_panel->cwd;
|
||||
char *new;
|
||||
new = concat_dir_and_file (old, cmd+3);
|
||||
new = mhl_str_dir_plus_file (old, cmd+3);
|
||||
sync_tree (new);
|
||||
g_free (new);
|
||||
}
|
||||
|
|
|
@ -26,13 +26,13 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "mhl/memory.h"
|
||||
#include "mhl/escape.h"
|
||||
#include <mhl/memory.h>
|
||||
#include <mhl/escape.h>
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "tty.h"
|
||||
|
@ -512,7 +512,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 = concat_dir_and_file (expanded, text);
|
||||
cur_word = mhl_str_dir_plus_file (expanded, text);
|
||||
g_free (expanded);
|
||||
canonicalize_pathname (cur_word);
|
||||
cur_path = strchr (cur_path, 0) + 1;
|
||||
|
@ -807,7 +807,7 @@ try_complete (char *text, int *start, int *end, INPUT_COMPLETE_FLAGS flags)
|
|||
c = *s;
|
||||
*s = 0;
|
||||
if (*cdpath){
|
||||
r = concat_dir_and_file (cdpath, word);
|
||||
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);
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
#endif
|
||||
#include <unistd.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "tty.h"
|
||||
#include "cons.saver.h"
|
||||
|
@ -143,7 +145,7 @@ handle_console_linux (unsigned char action)
|
|||
open ("/dev/null", O_WRONLY);
|
||||
if (tty_name) {
|
||||
/* Exec the console save/restore handler */
|
||||
mc_conssaver = concat_dir_and_file (SAVERDIR, "cons.saver");
|
||||
mc_conssaver = mhl_str_dir_plus_file (SAVERDIR, "cons.saver");
|
||||
execl (mc_conssaver, "cons.saver", tty_name, (char *) NULL);
|
||||
}
|
||||
/* Console is not a tty or execl() failed */
|
||||
|
|
|
@ -53,6 +53,8 @@
|
|||
#endif
|
||||
#include <unistd.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#define LINUX_CONS_SAVER_C
|
||||
#include "cons.saver.h"
|
||||
|
||||
|
|
|
@ -25,9 +25,10 @@
|
|||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "tty.h"
|
||||
#include "user.h"
|
||||
|
@ -440,11 +441,11 @@ regex_command (const char *filename, const char *action, int *move_dir)
|
|||
int mc_user_ext = 1;
|
||||
int home_error = 0;
|
||||
|
||||
extension_file = concat_dir_and_file (home_dir, MC_USER_EXT);
|
||||
extension_file = mhl_str_dir_plus_file (home_dir, MC_USER_EXT);
|
||||
if (!exist_file (extension_file)) {
|
||||
g_free (extension_file);
|
||||
check_stock_mc_ext:
|
||||
extension_file = concat_dir_and_file (mc_home, MC_LIB_EXT);
|
||||
extension_file = mhl_str_dir_plus_file (mc_home, MC_LIB_EXT);
|
||||
mc_user_ext = 0;
|
||||
}
|
||||
data = load_file (extension_file);
|
||||
|
|
54
src/file.c
54
src/file.c
|
@ -50,8 +50,9 @@
|
|||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "mhl/memory.h"
|
||||
#include "mhl/escape.h"
|
||||
#include <mhl/memory.h>
|
||||
#include <mhl/escape.h>
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "tty.h"
|
||||
|
@ -921,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 = concat_dir_and_file (d, x_basename (s));
|
||||
dest_dir = mhl_str_dir_plus_file (d, x_basename (s));
|
||||
} else {
|
||||
dest_dir = g_strdup (d);
|
||||
goto dont_mkdir;
|
||||
|
@ -967,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 = concat_dir_and_file (s, next->d_name);
|
||||
path = mhl_str_dir_plus_file (s, next->d_name);
|
||||
|
||||
(*ctx->stat_func) (path, &buf);
|
||||
if (S_ISDIR (buf.st_mode)) {
|
||||
mdpath = concat_dir_and_file (dest_dir, next->d_name);
|
||||
mdpath = mhl_str_dir_plus_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
|
||||
|
@ -982,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 = concat_dir_and_file (dest_dir, x_basename (path));
|
||||
dest_file = mhl_str_dir_plus_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);
|
||||
|
@ -1172,7 +1173,7 @@ move_dir_dir (FileOpContext *ctx, const char *s, const char *d,
|
|||
destdir = g_strdup (d);
|
||||
move_over = 1;
|
||||
} else
|
||||
destdir = concat_dir_and_file (d, x_basename (s));
|
||||
destdir = mhl_str_dir_plus_file (d, x_basename (s));
|
||||
|
||||
if (sbuf.st_dev == dbuf.st_dev && sbuf.st_ino == dbuf.st_ino) {
|
||||
int msize = COLS - 36;
|
||||
|
@ -1329,7 +1330,7 @@ recursive_erase (FileOpContext *ctx, const char *s, off_t *progress_count,
|
|||
continue;
|
||||
if (!strcmp (next->d_name, ".."))
|
||||
continue;
|
||||
path = concat_dir_and_file (s, next->d_name);
|
||||
path = mhl_str_dir_plus_file (s, next->d_name);
|
||||
if (mc_lstat (path, &buf)) {
|
||||
g_free (path);
|
||||
mc_closedir (reading);
|
||||
|
@ -1520,7 +1521,7 @@ compute_dir_size (const char *dirname, off_t *ret_marked, double *ret_total)
|
|||
if (strcmp (dirent->d_name, "..") == 0)
|
||||
continue;
|
||||
|
||||
fullname = concat_dir_and_file (dirname, dirent->d_name);
|
||||
fullname = mhl_str_dir_plus_file (dirname, dirent->d_name);
|
||||
|
||||
res = mc_lstat (fullname, &s);
|
||||
|
||||
|
@ -1577,7 +1578,7 @@ panel_compute_totals (WPanel *panel, off_t *ret_marked, double *ret_total)
|
|||
double subdir_bytes = 0;
|
||||
|
||||
dir_name =
|
||||
concat_dir_and_file (panel->cwd, panel->dir.list[i].fname);
|
||||
mhl_str_dir_plus_file (panel->cwd, panel->dir.list[i].fname);
|
||||
compute_dir_size (dir_name, &subdir_count, &subdir_bytes);
|
||||
|
||||
*ret_marked += subdir_count;
|
||||
|
@ -1787,6 +1788,7 @@ panel_operate (void *source_panel, FileOperation operation,
|
|||
}
|
||||
} else if (operation != OP_DELETE) {
|
||||
char *dest_dir;
|
||||
char *dest_dir_;
|
||||
|
||||
/* Forced single operations default to the original name */
|
||||
if (force_single)
|
||||
|
@ -1796,9 +1798,31 @@ panel_operate (void *source_panel, FileOperation operation,
|
|||
else
|
||||
dest_dir = panel->cwd;
|
||||
|
||||
/*
|
||||
* Add trailing backslash only when do non-locally ops.
|
||||
* It saves user from occasional file renames (when destination
|
||||
* dir is deleted)
|
||||
*/
|
||||
if (force_single)
|
||||
/* just copy */
|
||||
dest_dir_ = mhl_str_dup (dest_dir);
|
||||
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);
|
||||
} else {
|
||||
dest_dir_ = mhl_str_dup (dest_dir);
|
||||
}
|
||||
if (!dest_dir_) {
|
||||
file_op_context_destroy (ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
dest =
|
||||
file_mask_dialog (ctx, operation, cmd_buf, dest_dir,
|
||||
file_mask_dialog (ctx, operation, cmd_buf, dest_dir_,
|
||||
single_entry, &do_bg);
|
||||
mhl_mem_free(dest_dir_);
|
||||
|
||||
if (!dest) {
|
||||
file_op_context_destroy (ctx);
|
||||
return 0;
|
||||
|
@ -1862,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 = concat_dir_and_file (panel->cwd, source);
|
||||
source_with_path = mhl_str_dir_plus_file (panel->cwd, source);
|
||||
#endif /* WITH_FULL_PATHS */
|
||||
|
||||
if (operation == OP_DELETE) {
|
||||
|
@ -1877,7 +1901,7 @@ panel_operate (void *source_panel, FileOperation operation,
|
|||
if (temp == NULL) {
|
||||
value = transform_error;
|
||||
} else {
|
||||
char *temp2 = concat_dir_and_file (dest, temp);
|
||||
char *temp2 = mhl_str_dir_plus_file (dest, temp);
|
||||
g_free (dest);
|
||||
dest = temp2;
|
||||
temp = NULL;
|
||||
|
@ -1955,7 +1979,7 @@ panel_operate (void *source_panel, FileOperation operation,
|
|||
|
||||
#ifdef WITH_FULL_PATHS
|
||||
g_free (source_with_path);
|
||||
source_with_path = concat_dir_and_file (panel->cwd, source);
|
||||
source_with_path = mhl_str_dir_plus_file (panel->cwd, source);
|
||||
#endif /* WITH_FULL_PATHS */
|
||||
|
||||
if (operation == OP_DELETE) {
|
||||
|
@ -1971,7 +1995,7 @@ panel_operate (void *source_panel, FileOperation operation,
|
|||
if (temp == NULL)
|
||||
value = transform_error;
|
||||
else {
|
||||
char *temp2 = concat_dir_and_file (dest, temp);
|
||||
char *temp2 = mhl_str_dir_plus_file (dest, temp);
|
||||
|
||||
source_with_path = mhl_shell_unescape_buf(source_with_path);
|
||||
temp2 = mhl_shell_unescape_buf(temp2);
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "global.h"
|
||||
|
||||
static char *
|
||||
|
@ -37,7 +39,7 @@ get_absolute_name (const char *file)
|
|||
if (file[0] == PATH_SEP)
|
||||
return g_strdup (file);
|
||||
mc_get_current_wd (dir, MC_MAXPATHLEN);
|
||||
return concat_dir_and_file (dir, file);
|
||||
return mhl_str_dir_plus_file (dir, file);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -60,7 +62,7 @@ my_mkdir_rec (char *s, mode_t mode)
|
|||
return -1;
|
||||
}
|
||||
|
||||
p = concat_dir_and_file (s, "..");
|
||||
p = mhl_str_dir_plus_file (s, "..");
|
||||
q = vfs_canon (p);
|
||||
g_free (p);
|
||||
|
||||
|
|
13
src/find.c
13
src/find.c
|
@ -25,9 +25,10 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "tty.h"
|
||||
#include "win.h"
|
||||
|
@ -354,7 +355,7 @@ push_directory (const char *dir)
|
|||
dir_stack *new;
|
||||
|
||||
new = g_new (dir_stack, 1);
|
||||
new->name = concat_dir_and_file (dir, "");
|
||||
new->name = mhl_str_dir_plus_file (dir, NULL);
|
||||
new->prev = dir_stack_base;
|
||||
dir_stack_base = new;
|
||||
}
|
||||
|
@ -516,7 +517,7 @@ search_content (Dlg_head *h, const char *directory, const char *filename)
|
|||
int file_fd;
|
||||
int ret_val = 0;
|
||||
|
||||
fname = concat_dir_and_file (directory, filename);
|
||||
fname = mhl_str_dir_plus_file (directory, filename);
|
||||
|
||||
if (mc_stat (fname, &s) != 0 || !S_ISREG (s.st_mode)){
|
||||
g_free (fname);
|
||||
|
@ -692,7 +693,7 @@ do_search (struct Dlg_head *h)
|
|||
}
|
||||
|
||||
if (subdirs_left && find_recursively && directory) { /* Can directory be NULL ? */
|
||||
char *tmp_name = concat_dir_and_file (directory, dp->d_name);
|
||||
char *tmp_name = mhl_str_dir_plus_file (directory, dp->d_name);
|
||||
if (!mc_lstat (tmp_name, &tmp_stat)
|
||||
&& S_ISDIR (tmp_stat.st_mode)) {
|
||||
push_directory (tmp_name);
|
||||
|
@ -752,8 +753,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 concat_dir_and_file (dirname + 2, filename);
|
||||
return concat_dir_and_file (dirname, filename);
|
||||
return mhl_str_dir_plus_file (dirname + 2, filename);
|
||||
return mhl_str_dir_plus_file (dirname, filename);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -32,11 +32,12 @@
|
|||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "tty.h" /* COLS */
|
||||
#include "color.h" /* dialog_colors */
|
||||
|
@ -1447,7 +1448,7 @@ load_hotlist (void)
|
|||
}
|
||||
|
||||
if (!hotlist_file_name)
|
||||
hotlist_file_name = concat_dir_and_file (home_dir, HOTLIST_FILENAME);
|
||||
hotlist_file_name = mhl_str_dir_plus_file (home_dir, HOTLIST_FILENAME);
|
||||
|
||||
hotlist = new_hotlist ();
|
||||
hotlist->type = HL_TYPE_GROUP;
|
||||
|
|
|
@ -29,11 +29,12 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "tty.h"
|
||||
#include "dir.h"
|
||||
|
@ -1136,7 +1137,7 @@ copy_readlink (WPanel *panel)
|
|||
if (S_ISLNK (selection (panel)->st.st_mode)) {
|
||||
char buffer[MC_MAXPATHLEN];
|
||||
char *p =
|
||||
concat_dir_and_file (panel->cwd, selection (panel)->fname);
|
||||
mhl_str_dir_plus_file (panel->cwd, selection (panel)->fname);
|
||||
int i;
|
||||
|
||||
i = mc_readlink (p, buffer, MC_MAXPATHLEN - 1);
|
||||
|
@ -1616,6 +1617,8 @@ update_xterm_title_path (void)
|
|||
if (!is_printable ((unsigned char) *s))
|
||||
*s = '?';
|
||||
} while (*++s);
|
||||
if (!alternate_plus_minus)
|
||||
numeric_keypad_mode ();
|
||||
fprintf (stdout, "\33]0;mc - %s\7", p);
|
||||
fflush (stdout);
|
||||
g_free (p);
|
||||
|
|
15
src/screen.c
15
src/screen.c
|
@ -25,9 +25,10 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "tty.h"
|
||||
#include "dir.h"
|
||||
|
@ -709,7 +710,7 @@ display_mini_info (WPanel *panel)
|
|||
char *link, link_target [MC_MAXPATHLEN];
|
||||
int len;
|
||||
|
||||
link = concat_dir_and_file (panel->cwd, panel->dir.list [panel->selected].fname);
|
||||
link = mhl_str_dir_plus_file (panel->cwd, panel->dir.list [panel->selected].fname);
|
||||
len = mc_readlink (link, link_target, MC_MAXPATHLEN - 1);
|
||||
g_free (link);
|
||||
if (len > 0){
|
||||
|
@ -1974,7 +1975,7 @@ do_enter_on_file_entry (file_entry *fe)
|
|||
return 1;
|
||||
|
||||
/* Check if the file is executable */
|
||||
full_name = concat_dir_and_file (current_panel->cwd, fe->fname);
|
||||
full_name = mhl_str_dir_plus_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;
|
||||
|
@ -1993,7 +1994,7 @@ do_enter_on_file_entry (file_entry *fe)
|
|||
char *tmp;
|
||||
int ret;
|
||||
|
||||
tmp = concat_dir_and_file (vfs_get_current_dir (), fe->fname);
|
||||
tmp = mhl_str_dir_plus_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
|
||||
|
@ -2030,10 +2031,10 @@ chdir_other_panel (WPanel *panel)
|
|||
}
|
||||
|
||||
if (!S_ISDIR (panel->dir.list [panel->selected].st.st_mode)) {
|
||||
new_dir = concat_dir_and_file (panel->cwd, "..");
|
||||
new_dir = mhl_str_dir_plus_file (panel->cwd, "..");
|
||||
sel_entry = strrchr(panel->cwd, PATH_SEP);
|
||||
} else
|
||||
new_dir = concat_dir_and_file (panel->cwd, panel->dir.list [panel->selected].fname);
|
||||
new_dir = mhl_str_dir_plus_file (panel->cwd, panel->dir.list [panel->selected].fname);
|
||||
|
||||
change_panel ();
|
||||
do_cd (new_dir, cd_exact);
|
||||
|
@ -2099,7 +2100,7 @@ chdir_to_readlink (WPanel *panel)
|
|||
if (*buffer == PATH_SEP)
|
||||
new_dir = g_strdup (buffer);
|
||||
else
|
||||
new_dir = concat_dir_and_file (panel->cwd, buffer);
|
||||
new_dir = mhl_str_dir_plus_file (panel->cwd, buffer);
|
||||
|
||||
change_panel ();
|
||||
do_cd (new_dir, cd_exact);
|
||||
|
|
15
src/setup.c
15
src/setup.c
|
@ -20,10 +20,11 @@
|
|||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "tty.h"
|
||||
#include "dir.h"
|
||||
|
@ -281,7 +282,7 @@ save_layout (void)
|
|||
int i;
|
||||
char buffer [BUF_TINY];
|
||||
|
||||
profile = concat_dir_and_file (home_dir, PROFILE_NAME);
|
||||
profile = mhl_str_dir_plus_file (home_dir, PROFILE_NAME);
|
||||
|
||||
/* Save integer options */
|
||||
for (i = 0; layout [i].opt_name; i++){
|
||||
|
@ -298,7 +299,7 @@ save_configure (void)
|
|||
char *profile;
|
||||
int i;
|
||||
|
||||
profile = concat_dir_and_file (home_dir, PROFILE_NAME);
|
||||
profile = mhl_str_dir_plus_file (home_dir, PROFILE_NAME);
|
||||
|
||||
/* Save integer options */
|
||||
for (i = 0; int_options[i].opt_name; i++)
|
||||
|
@ -346,7 +347,7 @@ save_setup (void)
|
|||
char *profile;
|
||||
|
||||
saving_setup = 1;
|
||||
profile = concat_dir_and_file (home_dir, PROFILE_NAME);
|
||||
profile = mhl_str_dir_plus_file (home_dir, PROFILE_NAME);
|
||||
|
||||
save_configure ();
|
||||
|
||||
|
@ -481,9 +482,9 @@ setup_init (void)
|
|||
if (profile_name)
|
||||
return profile_name;
|
||||
|
||||
profile = concat_dir_and_file (home_dir, PROFILE_NAME);
|
||||
profile = mhl_str_dir_plus_file (home_dir, PROFILE_NAME);
|
||||
if (!exist_file (profile)){
|
||||
inifile = concat_dir_and_file (mc_home, "mc.ini");
|
||||
inifile = mhl_str_dir_plus_file (mc_home, "mc.ini");
|
||||
if (exist_file (inifile)){
|
||||
g_free (profile);
|
||||
profile = inifile;
|
||||
|
@ -506,7 +507,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 = concat_dir_and_file (mc_home, "mc.lib");
|
||||
global_profile_name = mhl_str_dir_plus_file (mc_home, "mc.lib");
|
||||
|
||||
/* Load integer boolean options */
|
||||
for (i = 0; int_options[i].opt_name; i++)
|
||||
|
|
|
@ -37,11 +37,12 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "treestore.h"
|
||||
#include "profile.h"
|
||||
|
@ -265,7 +266,7 @@ tree_store_load(void)
|
|||
char *name;
|
||||
int retval;
|
||||
|
||||
name = concat_dir_and_file(home_dir, MC_TREE);
|
||||
name = mhl_str_dir_plus_file(home_dir, MC_TREE);
|
||||
retval = tree_store_load_from(name);
|
||||
g_free(name);
|
||||
|
||||
|
@ -371,7 +372,7 @@ tree_store_save(void)
|
|||
char *name;
|
||||
int retval;
|
||||
|
||||
tmp = concat_dir_and_file(home_dir, MC_TREE_TMP);
|
||||
tmp = mhl_str_dir_plus_file(home_dir, MC_TREE_TMP);
|
||||
retval = tree_store_save_to(tmp);
|
||||
|
||||
if (retval) {
|
||||
|
@ -379,7 +380,7 @@ tree_store_save(void)
|
|||
return retval;
|
||||
}
|
||||
|
||||
name = concat_dir_and_file(home_dir, MC_TREE);
|
||||
name = mhl_str_dir_plus_file(home_dir, MC_TREE);
|
||||
retval = rename(tmp, name);
|
||||
|
||||
g_free(tmp);
|
||||
|
@ -605,7 +606,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 = concat_dir_and_file(ts.check_name, subname);
|
||||
name = mhl_str_dir_plus_file(ts.check_name, subname);
|
||||
|
||||
/* Search for the subdirectory */
|
||||
current = ts.check_start;
|
||||
|
@ -795,7 +796,7 @@ tree_store_rescan(const char *dir)
|
|||
continue;
|
||||
}
|
||||
|
||||
full_name = concat_dir_and_file(dir, dp->d_name);
|
||||
full_name = mhl_str_dir_plus_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);
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "tty.h"
|
||||
#include "color.h"
|
||||
|
@ -721,11 +723,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 = concat_dir_and_file \
|
||||
menu = mhl_str_dir_plus_file \
|
||||
(home_dir, edit_widget ? CEDIT_HOME_MENU : MC_HOME_MENU);
|
||||
if (!exist_file (menu)){
|
||||
g_free (menu);
|
||||
menu = concat_dir_and_file \
|
||||
menu = mhl_str_dir_plus_file \
|
||||
(mc_home, edit_widget ? CEDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
|
||||
}
|
||||
}
|
||||
|
|
25
src/util.c
25
src/util.c
|
@ -35,7 +35,8 @@
|
|||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "mhl/escape.h"
|
||||
#include <mhl/escape.h>
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "profile.h"
|
||||
|
@ -688,7 +689,7 @@ load_mc_home_file (const char *filename, char **allocated_filename)
|
|||
char *lang;
|
||||
char *data;
|
||||
|
||||
hintfile_base = concat_dir_and_file (mc_home, filename);
|
||||
hintfile_base = mhl_str_dir_plus_file (mc_home, filename);
|
||||
lang = guess_message_value ();
|
||||
|
||||
hintfile = g_strconcat (hintfile_base, ".", lang, (char *) NULL);
|
||||
|
@ -1247,18 +1248,6 @@ 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)
|
||||
|
@ -1319,7 +1308,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 = concat_dir_and_file (mc_tmpdir (), prefix);
|
||||
tmpbase = mhl_str_dir_plus_file (mc_tmpdir (), prefix);
|
||||
} else {
|
||||
tmpbase = g_strdup (prefix);
|
||||
}
|
||||
|
@ -1387,7 +1376,7 @@ load_file_position (const char *filename, long *line, long *column)
|
|||
*column = 0;
|
||||
|
||||
/* open file with positions */
|
||||
fn = concat_dir_and_file (home_dir, MC_FILEPOS);
|
||||
fn = mhl_str_dir_plus_file (home_dir, MC_FILEPOS);
|
||||
f = fopen (fn, "r");
|
||||
g_free (fn);
|
||||
if (!f)
|
||||
|
@ -1434,8 +1423,8 @@ save_file_position (const char *filename, long line, long column)
|
|||
|
||||
len = strlen (filename);
|
||||
|
||||
tmp = concat_dir_and_file (home_dir, MC_FILEPOS_TMP);
|
||||
fn = concat_dir_and_file (home_dir, MC_FILEPOS);
|
||||
tmp = mhl_str_dir_plus_file (home_dir, MC_FILEPOS_TMP);
|
||||
fn = mhl_str_dir_plus_file (home_dir, MC_FILEPOS);
|
||||
|
||||
/* open temporary file */
|
||||
t = fopen (tmp, "w");
|
||||
|
|
|
@ -66,7 +66,6 @@ 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);
|
||||
|
|
|
@ -32,9 +32,10 @@
|
|||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "tty.h"
|
||||
#include "color.h"
|
||||
|
@ -865,7 +866,7 @@ history_get (const char *input_name)
|
|||
return NULL;
|
||||
if (!*input_name)
|
||||
return NULL;
|
||||
profile = concat_dir_and_file (home_dir, HISTORY_FILE_NAME);
|
||||
profile = mhl_str_dir_plus_file (home_dir, HISTORY_FILE_NAME);
|
||||
for (i = 0;; i++) {
|
||||
char key_name[BUF_TINY];
|
||||
char this_entry[BUF_LARGE];
|
||||
|
@ -903,7 +904,7 @@ history_put (const char *input_name, GList *h)
|
|||
if (!num_history_items_recorded) /* this is how to disable */
|
||||
return;
|
||||
|
||||
profile = concat_dir_and_file (home_dir, HISTORY_FILE_NAME);
|
||||
profile = mhl_str_dir_plus_file (home_dir, HISTORY_FILE_NAME);
|
||||
|
||||
if ((i = open (profile, O_CREAT | O_EXCL, S_IRUSR | S_IWUSR)) != -1)
|
||||
close (i);
|
||||
|
|
|
@ -20,8 +20,9 @@ context default
|
|||
keyword , brightcyan
|
||||
keyword ; brightmagenta
|
||||
keyword whole self brightred
|
||||
keyword whole access yellow
|
||||
keyword whole and yellow
|
||||
keyword whole as yellow
|
||||
keyword whole assert yellow
|
||||
keyword whole break yellow
|
||||
keyword whole class yellow
|
||||
keyword whole continue yellow
|
||||
|
@ -48,52 +49,81 @@ context default
|
|||
keyword whole return yellow
|
||||
keyword whole try yellow
|
||||
keyword whole while yellow
|
||||
keyword whole with yellow
|
||||
keyword whole yield yellow
|
||||
|
||||
keyword whole abs brightcyan
|
||||
keyword whole apply brightcyan
|
||||
keyword whole all brightcyan
|
||||
keyword whole any brightcyan
|
||||
keyword whole basestring brightcyan
|
||||
keyword whole bin brightcyan
|
||||
keyword whole bool brightcyan
|
||||
keyword whole callable brightcyan
|
||||
keyword whole chr brightcyan
|
||||
keyword whole classmethod brightcyan
|
||||
keyword whole cmp brightcyan
|
||||
keyword whole coerce brightcyan
|
||||
keyword whole compile brightcyan
|
||||
keyword whole complex brightcyan
|
||||
keyword whole delattr brightcyan
|
||||
keyword whole dict brightcyan
|
||||
keyword whole dir brightcyan
|
||||
keyword whole divmod brightcyan
|
||||
keyword whole enumerate brightcyan
|
||||
keyword whole eval brightcyan
|
||||
keyword whole exec brightcyan
|
||||
keyword whole execfile brightcyan
|
||||
keyword whole file brightcyan
|
||||
keyword whole filter brightcyan
|
||||
keyword whole float brightcyan
|
||||
keyword whole frozenset brightcyan
|
||||
keyword whole getattr brightcyan
|
||||
keyword whole globals brightcyan
|
||||
keyword whole hasattr brightcyan
|
||||
keyword whole hash brightcyan
|
||||
keyword whole help brightcyan
|
||||
keyword whole hex brightcyan
|
||||
keyword whole id brightcyan
|
||||
keyword whole input brightcyan
|
||||
keyword whole int brightcyan
|
||||
keyword whole isinstance brightcyan
|
||||
keyword whole issubclass brightcyan
|
||||
keyword whole iter brightcyan
|
||||
keyword whole len brightcyan
|
||||
keyword whole list brightcyan
|
||||
keyword whole locals brightcyan
|
||||
keyword whole long brightcyan
|
||||
keyword whole map brightcyan
|
||||
keyword whole max brightcyan
|
||||
keyword whole min brightcyan
|
||||
keyword whole next brightcyan
|
||||
keyword whole object brightcyan
|
||||
keyword whole oct brightcyan
|
||||
keyword whole open brightcyan
|
||||
keyword whole ord brightcyan
|
||||
keyword whole pow brightcyan
|
||||
keyword whole print brightcyan
|
||||
keyword whole property brightcyan
|
||||
keyword whole range brightcyan
|
||||
keyword whole raw_input brightcyan
|
||||
keyword whole reduce brightcyan
|
||||
keyword whole reload brightcyan
|
||||
keyword whole repr brightcyan
|
||||
keyword whole reversed brightcyan
|
||||
keyword whole round brightcyan
|
||||
keyword whole setattr brightcyan
|
||||
keyword whole slice brightcyan
|
||||
keyword whole sorted brightcyan
|
||||
keyword whole staticmethod brightcyan
|
||||
keyword whole str brightcyan
|
||||
keyword whole sum brightcyan
|
||||
keyword whole super brightcyan
|
||||
keyword whole tuple brightcyan
|
||||
keyword whole type brightcyan
|
||||
keyword whole unichr brightcyan
|
||||
keyword whole unicode brightcyan
|
||||
keyword whole vars brightcyan
|
||||
keyword whole xrange brightcyan
|
||||
keyword whole zip brightcyan
|
||||
|
||||
keyword whole atof magenta
|
||||
keyword whole atoi magenta
|
||||
|
@ -160,47 +190,6 @@ context default
|
|||
keyword whole __oct__ lightgray
|
||||
keyword whole __hex__ lightgray
|
||||
|
||||
keyword whole __init__ lightgray
|
||||
keyword whole __del__ lightgray
|
||||
keyword whole __repr__ lightgray
|
||||
keyword whole __str__ lightgray
|
||||
keyword whole __cmp__ lightgray
|
||||
keyword whole __hash__ lightgray
|
||||
keyword whole __call__ lightgray
|
||||
keyword whole __getattr__ lightgray
|
||||
keyword whole __setattr__ lightgray
|
||||
keyword whole __delattr__ lightgray
|
||||
keyword whole __len__ lightgray
|
||||
keyword whole __getitem__ lightgray
|
||||
keyword whole __setitem__ lightgray
|
||||
keyword whole __delitem__ lightgray
|
||||
keyword whole __getslice__ lightgray
|
||||
keyword whole __setslice__ lightgray
|
||||
keyword whole __delslice__ lightgray
|
||||
keyword whole __add__ lightgray
|
||||
keyword whole __sub__ lightgray
|
||||
keyword whole __mul__ lightgray
|
||||
keyword whole __div__ lightgray
|
||||
keyword whole __mod__ lightgray
|
||||
keyword whole __divmod__ lightgray
|
||||
keyword whole __pow__ lightgray
|
||||
keyword whole __lshift__ lightgray
|
||||
keyword whole __rshift__ lightgray
|
||||
keyword whole __and__ lightgray
|
||||
keyword whole __xor__ lightgray
|
||||
keyword whole __or__ lightgray
|
||||
keyword whole __neg__ lightgray
|
||||
keyword whole __pos__ lightgray
|
||||
keyword whole __abs__ lightgray
|
||||
keyword whole __invert__ lightgray
|
||||
keyword whole __nonzero__ lightgray
|
||||
keyword whole __coerce__ lightgray
|
||||
keyword whole __int__ lightgray
|
||||
keyword whole __long__ lightgray
|
||||
keyword whole __float__ lightgray
|
||||
keyword whole __oct__ lightgray
|
||||
keyword whole __hex__ lightgray
|
||||
|
||||
keyword whole __radd__ lightgray
|
||||
keyword whole __rsub__ lightgray
|
||||
keyword whole __rmul__ lightgray
|
||||
|
@ -232,7 +221,7 @@ context """ """ green
|
|||
keyword \\\\ brightgreen
|
||||
keyword \\' brightgreen
|
||||
keyword \\\{abtnvfr\} brightgreen
|
||||
|
||||
|
||||
context # \n brown
|
||||
spellcheck
|
||||
context " " green
|
||||
|
|
|
@ -1,16 +1,12 @@
|
|||
if USE_SAMBA_FS
|
||||
SUBDIRS = samba extfs
|
||||
else
|
||||
SUBDIRS = extfs
|
||||
SAMBA_CFLAGS = -DCONFIGDIR=\""@configdir@"\"
|
||||
SAMBA_SUBDIRS = samba
|
||||
endif
|
||||
|
||||
DIST_SUBDIRS = extfs
|
||||
|
||||
if USE_SAMBA_FS
|
||||
AM_CFLAGS = $(GLIB_CFLAGS) -DCONFIGDIR=\""@configdir@"\"
|
||||
else
|
||||
AM_CFLAGS = $(GLIB_CFLAGS)
|
||||
endif
|
||||
SUBDIRS = extfs $(SAMBA_SUBDIRS)
|
||||
AM_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) $(SAMBA_CFLAGS)
|
||||
|
||||
BASICFILES = \
|
||||
cpio.c \
|
||||
|
|
11
vfs/extfs.c
11
vfs/extfs.c
|
@ -35,6 +35,9 @@
|
|||
#include <sys/wait.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "../src/global.h"
|
||||
#include "../src/tty.h" /* enable/disable interrupt key */
|
||||
#include "../src/wtools.h" /* message() */
|
||||
|
@ -246,7 +249,7 @@ extfs_open_archive (int fstype, const char *name, struct archive **pparc)
|
|||
tmp = name_quote (name, 0);
|
||||
}
|
||||
|
||||
mc_extfsdir = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR);
|
||||
mc_extfsdir = mhl_str_dir_plus_file (mc_home, "extfs" PATH_SEP_STR);
|
||||
cmd =
|
||||
g_strconcat (mc_extfsdir, extfs_prefixes[fstype], " list ",
|
||||
local_name ? local_name : tmp, (char *) NULL);
|
||||
|
@ -621,7 +624,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 = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR);
|
||||
mc_extfsdir = mhl_str_dir_plus_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);
|
||||
|
@ -650,7 +653,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 = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR);
|
||||
mc_extfsdir = mhl_str_dir_plus_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);
|
||||
|
@ -1295,7 +1298,7 @@ static int extfs_init (struct vfs_class *me)
|
|||
|
||||
(void) me;
|
||||
|
||||
mc_extfsini = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR "extfs.ini");
|
||||
mc_extfsini = mhl_str_dir_plus_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,
|
||||
|
|
10
vfs/ftpfs.c
10
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 = concat_dir_and_file( qhome (*bucket), remote_path +3-f );
|
||||
s = mhl_str_dir_plus_file( qhome (*bucket), remote_path +3-f );
|
||||
g_free (remote_path);
|
||||
remote_path = s;
|
||||
}
|
||||
|
@ -69,6 +69,8 @@ What to do with this?
|
|||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "../src/global.h"
|
||||
#include "../src/tty.h" /* enable/disable interrupt key */
|
||||
#include "../src/wtools.h" /* message() */
|
||||
|
@ -555,7 +557,7 @@ ftpfs_load_no_proxy_list (void)
|
|||
if (mc_file)
|
||||
return;
|
||||
|
||||
mc_file = concat_dir_and_file (mc_home, "mc.no_proxy");
|
||||
mc_file = mhl_str_dir_plus_file (mc_home, "mc.no_proxy");
|
||||
if (exist_file (mc_file) &&
|
||||
(npf = fopen (mc_file, "r"))) {
|
||||
while (fgets (s, sizeof (s), npf)) {
|
||||
|
@ -1230,7 +1232,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 = concat_dir_and_file (remote_path, ".");
|
||||
char *path = mhl_str_dir_plus_file (remote_path, ".");
|
||||
sock =
|
||||
ftpfs_open_data_connection (me, super, "LIST -la", path, TYPE_ASCII,
|
||||
0);
|
||||
|
@ -1886,7 +1888,7 @@ static int ftpfs_netrc_lookup (const char *host, char **login, char **pass)
|
|||
}
|
||||
|
||||
/* Load current .netrc */
|
||||
netrcname = concat_dir_and_file (home_dir, ".netrc");
|
||||
netrcname = mhl_str_dir_plus_file (home_dir, ".netrc");
|
||||
netrcp = netrc = load_file (netrcname);
|
||||
if (netrc == NULL) {
|
||||
g_free (netrcname);
|
||||
|
|
4
vfs/gc.c
4
vfs/gc.c
|
@ -31,6 +31,8 @@
|
|||
#include <signal.h>
|
||||
#include <ctype.h> /* is_digit() */
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "../src/global.h"
|
||||
#include "../src/tty.h" /* enable/disable interrupt key */
|
||||
#include "../src/wtools.h" /* message() */
|
||||
|
@ -122,7 +124,7 @@ vfs_getid (struct vfs_class *vclass, const char *dir)
|
|||
vfsid id = NULL;
|
||||
|
||||
/* append slash if needed */
|
||||
dir1 = concat_dir_and_file (dir, "");
|
||||
dir1 = mhl_str_dir_plus_file (dir, "");
|
||||
if (vclass->getid)
|
||||
id = (*vclass->getid) (vclass, dir1);
|
||||
|
||||
|
|
|
@ -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 = concat_dir_and_file (mcfs_gethome (*mc),
|
||||
s = mhl_str_dir_plus_file (mcfs_gethome (*mc),
|
||||
remote_path + 3 - f);
|
||||
g_free (remote_path);
|
||||
remote_path = s;
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "../src/global.h"
|
||||
#include "../src/tty.h" /* enable/disable interrupt key */
|
||||
#include "../src/wtools.h" /* message() */
|
||||
|
@ -336,7 +338,7 @@ static int sfs_init (struct vfs_class *me)
|
|||
|
||||
(void) me;
|
||||
|
||||
mc_sfsini = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR "sfs.ini");
|
||||
mc_sfsini = mhl_str_dir_plus_file (mc_home, "extfs" PATH_SEP_STR "sfs.ini");
|
||||
cfg = fopen (mc_sfsini, "r");
|
||||
|
||||
if (!cfg){
|
||||
|
|
|
@ -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 = concat_dir_and_file ((*sc)->home, remote_path + 3 - f);
|
||||
s = mhl_str_dir_plus_file ((*sc)->home, remote_path + 3 - f);
|
||||
g_free (remote_path);
|
||||
return s;
|
||||
}
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
#include <signal.h>
|
||||
#include <ctype.h> /* is_digit() */
|
||||
|
||||
#include <mhl/string.h>
|
||||
|
||||
#include "../src/global.h"
|
||||
#include "../src/tty.h" /* enable/disable interrupt key */
|
||||
#include "../src/wtools.h" /* message() */
|
||||
|
@ -656,7 +658,7 @@ vfs_canon (const char *path)
|
|||
if (*path != PATH_SEP){
|
||||
char *local, *result;
|
||||
|
||||
local = concat_dir_and_file (current_dir, path);
|
||||
local = mhl_str_dir_plus_file (current_dir, path);
|
||||
|
||||
result = vfs_canon (local);
|
||||
g_free (local);
|
||||
|
|
Loading…
Reference in New Issue