Merge branch '3265_cleanup'

* 3265_cleanup: (22 commits)
  Update po/*.po files.
  tests/lib/search/Makefile.am: fix name of variable.
  Remove code required for GLib < 2.14.0.
  Minimal version of GLib is 2.14.0
  Ticket #3405: mcview: use VIEW_SELECTED_COLOR in plain mode.
  Hints: capitalize Lynx since it is the proper noun.
  (dirsize_status_update_cb): use local variables instead of type casting.
  doc/NEWS: cosmetics.
  (input_execute_cmd): refactoring.
  * background.c (background_attention): Fix memory leak.
  g_utf8_next_char() never returns NULL. Remove redundant checks.
  diffviewer: clarify support of UTF-8 codeset.
  Ticket #3246: misc/mcedit.menu.in: better grammar.
  Ticket #3262: rename variables.
  Add IS_PATH_SEP macro and use it.
  (edit_get_match_keyword_cmd): use PATH_SEP_STR instead of G_DIR_SEPARATOR_S.
  Update copyright years.
  (mc_search_regex_prepare_replace_str): refactoring.
  lib/search/regex.c: use [] to get char in string.
  (mc_search_prepare_replace_str2): make replace_str const.
  ...
This commit is contained in:
Andrew Borodin 2015-02-26 09:57:46 +03:00
commit a03fe94170
307 changed files with 1372 additions and 1444 deletions

View File

@ -19,7 +19,7 @@ required:
Autoconf 2.52 and above (latest is recommended)
Automake 1.5 and above (latest is recommended)
Gettext 0.11.5 and above
Glib 2.8 and above (2.14 and higher is recommended)
Glib 2.14 and above
Full list of requirements you can see at:
http://www.midnight-commander.org/wiki/doc/buildAndInstall/req

View File

@ -386,7 +386,7 @@ get glib from
ftp://ftp.gtk.org/pub/glib/
Minimal version of glib: 2.8.x
Minimal version of glib: 2.14.x
Recommended version: 2.14.x and higher.
Newer versions may work, but haven't been tested.

View File

@ -1,8 +1,7 @@
Read the INSTALL file for the complete instructions.
GNU Midnight Commander requires glib. Currently the 1.2.x and 2.0.x
series are supported. You may already have glib installed, but if you
don't, take it from ftp://ftp.gtk.org/pub/gtk/
GNU Midnight Commander requires glib2. You may already have glib
installed, but if you don't, take it from ftp://ftp.gtk.org/pub/gtk/
GNU Midnight Commander uses the S-Lang screen library by default. It
tries the S-Lang library installed on the system. If it's not found,

View File

@ -1,24 +1,29 @@
Version 4.8.13
- Core
* New engine of user-friendly interruption of long-time operations (#2136)
- Editor
* Improvements of syntax highlighting:
* CMake (#3216)
* PHP (#3230)
* Translate language names in the spelling assistant dialogue (#3233)
- Viewer
* Add separate normal(default) colour pair for viewer (#3204)
* Dealing with utf-8 man pages in view/open (#1539)
* "Goto line" is 1-based now (#3245)
- Misc
* Code cleanup (#3189, #3223, #3242)
* Add new skins: gray-green-purple256 and gray-orange-blue256 (#3190)
- Fixes
* First Backspace/Delete is ignored after mouse click in an input widget (#3225)
* Recursive find file doesn't work on Samba share (#3097)
* Recursive find file doesn't work on Windows NFS share (#3202)
@ -34,6 +39,7 @@ Version 4.8.13
* Incorrect enconding name for manual page (#3239)
* "User menu -> View manual page" doesn't do coloring (#3243)
Version 4.8.12
- Core

View File

@ -29,7 +29,7 @@ Dependencies
------------
To compile the GNU Midnight Commander, you need to have a copy of the
glib library version 2.8.x or newer, available at
glib library version 2.14.x or newer, available at
ftp://ftp.gtk.org/pub/glib/

View File

@ -29,7 +29,7 @@ http://www.midnight-commander.org/
Совет: У нас также имеется толковая страница руководства.
Совет: Вы хотите навигацию в стиле lynx? Установите это в диалоге
Совет: Вы хотите навигацию в стиле Lynx? Установите это в диалоге
Конфигурация.
Совет: Макросы % работают даже в командной строке.

View File

@ -24,7 +24,7 @@ Hint: VFS coolness: tap enter on a tar file to examine its contents.
Hint: We also have a nice manual page.
Hint: Do you want lynx-style navigation? Set it in the Configuration dialog.
Hint: Do you want Lynx-style navigation? Set it in the Configuration dialog.
Hint: % macros work even on the command line.

View File

@ -1,7 +1,7 @@
/*
Text conversion from one charset to another.
Copyright (C) 2001-2014
Copyright (C) 2001-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
Handle events in application.
Interface functions: init/deinit; start/stop
Copyright (C) 2011-2014
Copyright (C) 2011-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
Handle any events in application.
Manage events: add, delete, destroy, search
Copyright (C) 2011-2014
Copyright (C) 2011-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
Handle any events in application.
Raise events.
Copyright (C) 2011-2014
Copyright (C) 2011-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
File highlight plugin.
Interface functions
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
File highlight plugin.
Interface functions. get color pair index for highlighted file.
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
File highlight plugin.
Reading and parse rules from ini-files
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
GLIB - Library of useful routines for C programming
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:
@ -49,27 +49,6 @@
/*** public functions ****************************************************************************/
/* --------------------------------------------------------------------------------------------- */
#if ! GLIB_CHECK_VERSION (2, 13, 0)
/*
This is incomplete copy of same glib-function.
For older glib (less than 2.13) functional is enought.
For full version of glib welcome to glib update.
*/
gboolean
g_unichar_iszerowidth (gunichar c)
{
if (G_UNLIKELY (c == 0x00AD))
return FALSE;
if (G_UNLIKELY ((c >= 0x1160 && c < 0x1200) || c == 0x200B))
return TRUE;
return FALSE;
}
#endif /* ! GLIB_CHECK_VERSION (2, 13, 0) */
/* --------------------------------------------------------------------------------------------- */
#if ! GLIB_CHECK_VERSION (2, 16, 0)
/**
* g_strcmp0:

View File

@ -15,10 +15,6 @@
/*** declarations of public functions ************************************************************/
#if ! GLIB_CHECK_VERSION (2, 13, 0)
gboolean g_unichar_iszerowidth (gunichar);
#endif /* ! GLIB_CHECK_VERSION (2, 13, 0) */
#if ! GLIB_CHECK_VERSION (2, 16, 0)
int g_strcmp0 (const char *str1, const char *str2);
#endif /* ! GLIB_CHECK_VERSION (2, 16, 0) */

View File

@ -1,7 +1,7 @@
/*
Global structure for some library-related variables
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:

View File

@ -128,6 +128,7 @@
/* OS specific defines */
#define PATH_SEP '/'
#define PATH_SEP_STR "/"
#define IS_PATH_SEP(c) ((c) == PATH_SEP)
#define PATH_ENV_SEP ':'
#define TMPDIR_DEFAULT "/tmp"
#define SCRIPT_SUFFIX ""

View File

@ -4,7 +4,7 @@
Slavaz: Warning! this file is deprecated and should be replaced
by mcevents functional.
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Definitions of key bindings.
Copyright (C) 2005-2014
Copyright (C) 2005-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
File locking
Copyright (C) 2003-2014
Copyright (C) 2003-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Provides a log file to ease tracing the program.
Copyright (C) 2006-2014
Copyright (C) 2006-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Configure module for the Midnight Commander
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
This file is part of the Midnight Commander.

View File

@ -1,7 +1,7 @@
/*
Configure module for the Midnight Commander
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
This file is part of the Midnight Commander.

View File

@ -1,7 +1,7 @@
/*
paths to configuration files
Copyright (C) 2010-2014
Copyright (C) 2010-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Configure module for the Midnight Commander
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
This file is part of the Midnight Commander.

View File

@ -144,7 +144,7 @@ gboolean mc_search_is_type_avail (mc_search_type_t);
const mc_search_type_str_t *mc_search_types_list_get (size_t * num);
GString *mc_search_prepare_replace_str (mc_search_t * mc_search, GString * replace_str);
char *mc_search_prepare_replace_str2 (mc_search_t *, char *);
char *mc_search_prepare_replace_str2 (mc_search_t * lc_mc_search, const char *replace_str);
gboolean mc_search_is_fixed_search_str (mc_search_t *);

View File

@ -2,7 +2,7 @@
Search text engine.
Glob-style pattern matching
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
Search text engine.
HEX-style pattern matching
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
Search text engine.
Common share code for module.
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
Search text engine.
Plain search
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,13 +2,13 @@
Search text engine.
Regex search
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:
Slava Zanko <slavazanko@gmail.com>, 2009, 2010, 2011, 2013
Vitaliy Filippov <vitalif@yourcmc.ru>, 2011
Andrew Borodin <aborodin@vmail.ru>, 2013, 2014
Andrew Borodin <aborodin@vmail.ru>, 2013-2015
This file is part of the Midnight Commander.
@ -65,9 +65,6 @@ static gboolean
mc_search__regex_str_append_if_special (GString * copy_to, const GString * regex_str,
gsize * offset)
{
char *tmp_regex_str;
gsize spec_chr_len;
const char **spec_chr;
const char *special_chars[] = {
"\\s", "\\S",
"\\d", "\\D",
@ -83,39 +80,41 @@ mc_search__regex_str_append_if_special (GString * copy_to, const GString * regex
"\\E", "\\Q",
NULL
};
spec_chr = special_chars;
char *tmp_regex_str;
const char **spec_chr;
tmp_regex_str = &(regex_str->str[*offset]);
while (*spec_chr)
for (spec_chr = special_chars; *spec_chr != NULL; spec_chr++)
{
gsize spec_chr_len;
spec_chr_len = strlen (*spec_chr);
if (!strncmp (tmp_regex_str, *spec_chr, spec_chr_len))
if (strncmp (tmp_regex_str, *spec_chr, spec_chr_len) == 0
&& !strutils_is_char_escaped (regex_str->str, tmp_regex_str))
{
if (!strutils_is_char_escaped (regex_str->str, tmp_regex_str))
if (strncmp ("\\x", *spec_chr, spec_chr_len) == 0)
{
if (!strncmp ("\\x", *spec_chr, spec_chr_len))
{
if (*(tmp_regex_str + spec_chr_len) == '{')
if (tmp_regex_str[spec_chr_len] != '{')
spec_chr_len += 2;
else
{
while ((spec_chr_len < regex_str->len - *offset)
&& *(tmp_regex_str + spec_chr_len) != '}')
&& tmp_regex_str[spec_chr_len] != '}')
spec_chr_len++;
if (*(tmp_regex_str + spec_chr_len) == '}')
if (tmp_regex_str[spec_chr_len] == '}')
spec_chr_len++;
}
else
spec_chr_len += 2;
}
g_string_append_len (copy_to, tmp_regex_str, spec_chr_len);
*offset += spec_chr_len;
return TRUE;
}
}
spec_chr++;
}
return FALSE;
return FALSE;
}
/* --------------------------------------------------------------------------------------------- */
@ -382,17 +381,18 @@ mc_search_regex__replace_handle_esc_seq (const GString * replace_str, const gsiz
gsize * skip_len, int *ret)
{
char *curr_str = &(replace_str->str[current_pos]);
char c = *(curr_str + 1);
char c = curr_str[1];
if (replace_str->len > current_pos + 2)
{
if (c == '{')
{
for (*skip_len = 2; /* \{ */
current_pos + *skip_len < replace_str->len
&& *(curr_str + *skip_len) >= '0'
&& *(curr_str + *skip_len) <= '7'; (*skip_len)++);
if (current_pos + *skip_len < replace_str->len && *(curr_str + *skip_len) == '}')
current_pos + *skip_len < replace_str->len && curr_str[*skip_len] >= '0'
&& curr_str[*skip_len] <= '7'; (*skip_len)++)
;
if (current_pos + *skip_len < replace_str->len && curr_str[*skip_len] == '}')
{
(*skip_len)++;
*ret = REPLACE_PREPARE_T_ESCAPE_SEQ;
@ -408,13 +408,15 @@ mc_search_regex__replace_handle_esc_seq (const GString * replace_str, const gsiz
if (c == 'x')
{
*skip_len = 2; /* \x */
c = *(curr_str + 2);
c = curr_str[2];
if (c == '{')
{
for (*skip_len = 3; /* \x{ */
current_pos + *skip_len < replace_str->len
&& g_ascii_isxdigit ((guchar) * (curr_str + *skip_len)); (*skip_len)++);
if (current_pos + *skip_len < replace_str->len && *(curr_str + *skip_len) == '}')
&& g_ascii_isxdigit ((guchar) curr_str[*skip_len]); (*skip_len)++)
;
if (current_pos + *skip_len < replace_str->len && curr_str[*skip_len] == '}')
{
(*skip_len)++;
*ret = REPLACE_PREPARE_T_ESCAPE_SEQ;
@ -434,7 +436,7 @@ mc_search_regex__replace_handle_esc_seq (const GString * replace_str, const gsiz
}
else
{
c = *(curr_str + 3);
c = curr_str[3];
if (!g_ascii_isxdigit ((guchar) c))
*skip_len = 3; /* \xH */
else
@ -468,8 +470,8 @@ mc_search_regex__process_replace_str (const GString * replace_str, const gsize c
*skip_len = 0;
if ((*curr_str == '$') && (*(curr_str + 1) == '{') && ((*(curr_str + 2) & (char) 0xf0) == 0x30)
&& (replace_str->len > current_pos + 2))
if (replace_str->len > current_pos + 2 && curr_str[0] == '$' && curr_str[1] == '{'
&& (curr_str[2] & (char) 0xf0) == 0x30)
{
char *tmp_str;
@ -481,9 +483,10 @@ mc_search_regex__process_replace_str (const GString * replace_str, const gsize c
for (*skip_len = 0;
current_pos + *skip_len + 2 < replace_str->len
&& (*(curr_str + 2 + *skip_len) & (char) 0xf0) == 0x30; (*skip_len)++);
&& (curr_str[2 + *skip_len] & (char) 0xf0) == 0x30; (*skip_len)++)
;
if (*(curr_str + 2 + *skip_len) != '}')
if (curr_str[2 + *skip_len] != '}')
return REPLACE_PREPARE_T_NOTHING_SPECIAL;
tmp_str = g_strndup (curr_str + 2, *skip_len);
@ -497,7 +500,7 @@ mc_search_regex__process_replace_str (const GString * replace_str, const gsize c
return ret; /* capture buffer index >= 0 */
}
if ((*curr_str == '\\') && (replace_str->len > current_pos + 1))
if (curr_str[0] == '\\' && replace_str->len > current_pos + 1)
{
if (strutils_is_char_escaped (replace_str->str, curr_str))
{
@ -505,9 +508,9 @@ mc_search_regex__process_replace_str (const GString * replace_str, const gsize c
return REPLACE_PREPARE_T_NOTHING_SPECIAL;
}
if (g_ascii_isdigit (*(curr_str + 1)))
if (g_ascii_isdigit (curr_str[1]))
{
ret = g_ascii_digit_value (*(curr_str + 1)); /* capture buffer index >= 0 */
ret = g_ascii_digit_value (curr_str[1]); /* capture buffer index >= 0 */
*skip_len = 2; /* \\ and one digit */
return ret;
}
@ -517,7 +520,8 @@ mc_search_regex__process_replace_str (const GString * replace_str, const gsize c
ret = REPLACE_PREPARE_T_REPLACE_FLAG;
*skip_len += 2;
switch (*(curr_str + 1))
switch (curr_str[1])
{
case 'U':
*replace_flags |= REPLACE_T_UPP_TRANSFORM;
@ -556,7 +560,7 @@ mc_search_regex__process_append_str (GString * dest_str, const char *from, gsize
if (len == (gsize) (-1))
len = strlen (from);
if ((*replace_flags == REPLACE_T_NO_TRANSFORM) != 0)
if (*replace_flags == REPLACE_T_NO_TRANSFORM)
{
g_string_append_len (dest_str, from, len);
return;
@ -616,6 +620,7 @@ mc_search_regex__process_escape_sequence (GString * dest_str, const char *from,
len = strlen (from);
if (len == 0)
return;
if (from[i] == '{')
i++;
if (i >= len)
@ -935,8 +940,7 @@ mc_search_regex_prepare_replace_str (mc_search_t * lc_mc_search, GString * repla
int num_replace_tokens;
gsize loop;
gsize len = 0;
gchar *prev_str;
gsize prev = 0;
replace_transform_type_t replace_flags = REPLACE_T_NO_TRANSFORM;
num_replace_tokens =
@ -954,12 +958,12 @@ mc_search_regex_prepare_replace_str (mc_search_t * lc_mc_search, GString * repla
}
ret = g_string_sized_new (64);
prev_str = replace_str->str;
for (loop = 0; loop < replace_str->len - 1; loop++)
{
int lc_index;
gchar *tmp_str;
gsize len = 0;
lc_index = mc_search_regex__process_replace_str (replace_str, loop, &len, &replace_flags);
@ -967,39 +971,37 @@ mc_search_regex_prepare_replace_str (mc_search_t * lc_mc_search, GString * repla
{
if (len != 0)
{
mc_search_regex__process_append_str (ret, prev_str,
replace_str->str - prev_str + loop,
mc_search_regex__process_append_str (ret, replace_str->str + prev, loop - prev,
&replace_flags);
mc_search_regex__process_append_str (ret, replace_str->str + loop + 1, len - 1,
&replace_flags);
prev_str = replace_str->str + loop + len;
loop += len - 1;
prev = loop + len;
loop = prev - 1; /* prepare to loop++ */
}
continue;
}
if (lc_index == REPLACE_PREPARE_T_REPLACE_FLAG)
{
if (loop)
mc_search_regex__process_append_str (ret, prev_str,
replace_str->str - prev_str + loop,
if (loop != 0)
mc_search_regex__process_append_str (ret, replace_str->str + prev, loop - prev,
&replace_flags);
prev_str = replace_str->str + loop + len;
loop += len - 1;
prev = loop + len;
loop = prev - 1; /* prepare to loop++ */
continue;
}
/* escape sequence */
if (lc_index == REPLACE_PREPARE_T_ESCAPE_SEQ)
{
mc_search_regex__process_append_str (ret, prev_str,
replace_str->str + loop - prev_str,
mc_search_regex__process_append_str (ret, replace_str->str + prev, loop - prev,
&replace_flags);
/* call process_escape_sequence without starting '\\' */
mc_search_regex__process_escape_sequence (ret, replace_str->str + loop + 1, len - 1,
&replace_flags, lc_mc_search->is_utf8);
prev_str = replace_str->str + loop + len;
loop += len - 1;
prev = loop + len;
loop = prev - 1; /* prepare to loop++ */
continue;
}
@ -1014,17 +1016,18 @@ mc_search_regex_prepare_replace_str (mc_search_t * lc_mc_search, GString * repla
tmp_str = mc_search_regex__get_token_by_num (lc_mc_search, lc_index);
if (loop)
mc_search_regex__process_append_str (ret, prev_str, replace_str->str - prev_str + loop,
if (loop != 0)
mc_search_regex__process_append_str (ret, replace_str->str + prev, loop - prev,
&replace_flags);
prev_str = replace_str->str + loop + len;
mc_search_regex__process_append_str (ret, tmp_str, -1, &replace_flags);
g_free (tmp_str);
loop += len - 1;
prev = loop + len;
loop = prev - 1; /* prepare to loop++ */
}
mc_search_regex__process_append_str (ret, prev_str,
replace_str->str - prev_str + replace_str->len,
mc_search_regex__process_append_str (ret, replace_str->str + prev, replace_str->len - prev,
&replace_flags);
return ret;

View File

@ -2,7 +2,7 @@
Search text engine.
Interface functions
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:
@ -366,7 +366,7 @@ mc_search_prepare_replace_str (mc_search_t * lc_mc_search, GString * replace_str
/* --------------------------------------------------------------------------------------------- */
char *
mc_search_prepare_replace_str2 (mc_search_t * lc_mc_search, char *replace_str)
mc_search_prepare_replace_str2 (mc_search_t * lc_mc_search, const char *replace_str)
{
GString *ret;
GString *replace_str2;

View File

@ -1,7 +1,7 @@
/*
Provides a serialize/unserialize functionality for INI-like formats.
Copyright (C) 2011-2014
Copyright (C) 2011-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
Skins engine.
Work with colors - backward compatibility
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
Skins engine.
Work with colors
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
Skins engine.
Interface functions
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
Skins engine.
Set of hardcoded skins
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
Skins engine.
Reading and parse ini-files
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
Skins engine.
Work with line draving chars.
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Functions for replacing substrings in strings.
Copyright (C) 2013-2014
Copyright (C) 2013-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Functions for escaping and unescaping strings
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Common strings utilities
Copyright (C) 2007-2014
Copyright (C) 2007-2015
Free Software Foundation, Inc.
Written by:
@ -264,17 +264,7 @@ str_printf (GString * buffer, const char *format, ...)
va_list ap;
va_start (ap, format);
#if GLIB_CHECK_VERSION (2, 14, 0)
g_string_append_vprintf (buffer, format, ap);
#else
{
gchar *tmp;
tmp = g_strdup_vprintf (format, ap);
g_string_append (buffer, tmp);
g_free (tmp);
}
#endif
va_end (ap);
}

View File

@ -1,7 +1,7 @@
/*
8bit strings utilities
Copyright (C) 2007-2014
Copyright (C) 2007-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
ASCII strings utilities
Copyright (C) 2007-2014
Copyright (C) 2007-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
UTF-8 strings utilities
Copyright (C) 2007-2014
Copyright (C) 2007-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Compare strings while treating digits characters numerically.
Copyright (C) 1997-2014
Copyright (C) 1997-2015
Free Software Foundation, Inc.
This file is part of the GNU C Library.

View File

@ -1,6 +1,6 @@
/* A more useful interface to strtol.
Copyright (C) 1995-2014
Copyright (C) 1995-2015
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify

View File

@ -1,7 +1,7 @@
/*
Time formatting functions
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Simple timer for the Midnight Commander.
Copyright (C) 2013-2014
Copyright (C) 2013-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Internal stuff of color setup
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Color setup for NCurses screen library
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Color setup for S_Lang screen library
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
Color setup.
Interface functions.
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Keyboard support routines.
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Written by:

View File

@ -3,7 +3,7 @@
/*
Additional keyboard support routines.
Copyright (C) 1998-2014
Copyright (C) 1998-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Mouse managing
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
Interface to the terminal controlling library.
Ncurses wrapper.
Copyright (C) 2005-2014
Copyright (C) 2005-2015
Free Software Foundation, Inc.
Written by:

View File

@ -2,7 +2,7 @@
Interface to the terminal controlling library.
Slang wrapper.
Copyright (C) 2005-2014
Copyright (C) 2005-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Interface to the terminal controlling library.
Copyright (C) 2005-2014
Copyright (C) 2005-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Terminal management xterm and rxvt support
Copyright (C) 1995-2014
Copyright (C) 1995-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
X11 support for the Midnight Commander.
Copyright (C) 2005-2014
Copyright (C) 2005-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Various utilities
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Written by:
@ -152,28 +152,28 @@ resolve_symlinks (const vfs_path_t * vpath)
goto ret;
}
buf2[len] = 0;
if (*buf2 == PATH_SEP)
if (IS_PATH_SEP (*buf2))
strcpy (buf, buf2);
else
strcpy (r, buf2);
}
canonicalize_pathname (buf);
r = strchr (buf, 0);
if (!*r || *(r - 1) != PATH_SEP)
if (*r == '\0' || !IS_PATH_SEP (r[-1]))
/* FIXME: this condition is always true because r points to the EOL */
{
*r++ = PATH_SEP;
*r = 0;
*r = '\0';
}
*q = c;
p = q;
}
while (c != '\0');
if (!*buf)
if (*buf == '\0')
strcpy (buf, PATH_SEP_STR);
else if (*(r - 1) == PATH_SEP && r != buf + 1)
*(r - 1) = 0;
else if (IS_PATH_SEP (r[-1]) && r != buf + 1)
r[-1] = '\0';
ret:
g_free (buf2);
@ -653,17 +653,18 @@ x_basename (const char *s)
|| url_delim - s + strlen (VFS_PATH_URL_DELIMITER) < strlen (s))
{
/* avoid trailing PATH_SEP, if present */
if (s[strlen (s) - 1] == PATH_SEP)
{
while (--path_sep > s && *path_sep != PATH_SEP);
if (!IS_PATH_SEP (s[strlen (s) - 1]))
return (path_sep != NULL) ? path_sep + 1 : s;
while (--path_sep > s && !IS_PATH_SEP (*path_sep))
;
return (path_sep != s) ? path_sep + 1 : s;
}
else
return (path_sep != NULL) ? path_sep + 1 : s;
}
while (--url_delim > s && *url_delim != PATH_SEP);
while (--url_delim > s && *url_delim != PATH_SEP);
while (--url_delim > s && !IS_PATH_SEP (*url_delim))
;
while (--url_delim > s && !IS_PATH_SEP (*url_delim))
;
return (url_delim == s) ? s : url_delim + 1;
}

View File

@ -1,7 +1,7 @@
/*
Various utilities - Unix variants
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Written by:
@ -684,10 +684,10 @@ tilde_expand (const char *directory)
p = directory + 1;
/* d = "~" or d = "~/" */
if (!(*p) || (*p == PATH_SEP))
if (*p == '\0' || IS_PATH_SEP (*p))
{
passwd = getpwuid (geteuid ());
q = (*p == PATH_SEP) ? p + 1 : "";
q = IS_PATH_SEP (*p) ? p + 1 : "";
}
else
{
@ -843,12 +843,12 @@ custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags)
const size_t url_delim_len = strlen (VFS_PATH_URL_DELIMITER);
/* Detect and preserve UNC paths: //server/... */
if ((flags & CANON_PATH_GUARDUNC) && path[0] == PATH_SEP && path[1] == PATH_SEP)
if ((flags & CANON_PATH_GUARDUNC) != 0 && IS_PATH_SEP (path[0]) && IS_PATH_SEP (path[1]))
{
p = path + 2;
while (p[0] && p[0] != '/')
while (p[0] != '\0' && !IS_PATH_SEP (p[0]))
p++;
if (p[0] == '/' && p > path + 2)
if (IS_PATH_SEP (p[0]) && p > path + 2)
lpath = p;
}
@ -861,10 +861,11 @@ custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags)
p = lpath;
while (*p)
{
if (p[0] == PATH_SEP && p[1] == PATH_SEP && (p == lpath || *(p - 1) != ':'))
if (IS_PATH_SEP (p[0]) && IS_PATH_SEP (p[1]) && (p == lpath || *(p - 1) != ':'))
{
s = p + 1;
while (*(++s) == PATH_SEP);
while (IS_PATH_SEP (*(++s)))
;
str_move (p + 1, s);
}
p++;
@ -877,7 +878,7 @@ custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags)
p = lpath;
while (*p)
{
if (p[0] == PATH_SEP && p[1] == '.' && p[2] == PATH_SEP)
if (IS_PATH_SEP (p[0]) && p[1] == '.' && IS_PATH_SEP (p[2]))
str_move (p, p + 2);
else
p++;
@ -890,7 +891,7 @@ custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags)
/* Remove trailing slashes */
p = lpath + strlen (lpath) - 1;
while (p > lpath && *p == PATH_SEP)
while (p > lpath && IS_PATH_SEP (*p))
{
if (p >= lpath - (url_delim_len + 1)
&& strncmp (p - url_delim_len + 1, VFS_PATH_URL_DELIMITER, url_delim_len) == 0)
@ -899,7 +900,7 @@ custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags)
}
/* Remove leading "./" */
if (lpath[0] == '.' && lpath[1] == PATH_SEP)
if (lpath[0] == '.' && IS_PATH_SEP (lpath[1]))
{
if (lpath[2] == 0)
{
@ -916,7 +917,7 @@ custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags)
len = strlen (lpath);
if (len < 2)
return;
if (lpath[len - 1] == PATH_SEP
if (IS_PATH_SEP (lpath[len - 1])
&& (len < url_delim_len
|| strncmp (lpath + len - url_delim_len, VFS_PATH_URL_DELIMITER,
url_delim_len) != 0))
@ -925,7 +926,7 @@ custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags)
}
else
{
if (lpath[len - 1] == '.' && lpath[len - 2] == PATH_SEP)
if (lpath[len - 1] == '.' && IS_PATH_SEP (lpath[len - 2]))
{
if (len == 2)
{
@ -950,7 +951,8 @@ custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags)
p = lpath;
while (p[0] && p[1] && p[2])
{
if ((p[0] != PATH_SEP || p[1] != '.' || p[2] != '.') || (p[3] != PATH_SEP && p[3] != 0))
if (!IS_PATH_SEP (p[0]) || p[1] != '.' || p[2] != '.'
|| (!IS_PATH_SEP (p[3]) && p[3] != '\0'))
{
p++;
continue;
@ -962,7 +964,8 @@ custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags)
&& strncmp (s - url_delim_len + 2, VFS_PATH_URL_DELIMITER, url_delim_len) == 0)
{
s -= (url_delim_len - 2);
while (s >= lpath && *s-- != PATH_SEP);
while (s >= lpath && !IS_PATH_SEP (*s--))
;
}
while (s >= lpath)
@ -973,8 +976,9 @@ custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags)
char *vfs_prefix = s - url_delim_len;
struct vfs_class *vclass;
while (vfs_prefix > lpath && *--vfs_prefix != PATH_SEP);
if (*vfs_prefix == PATH_SEP)
while (vfs_prefix > lpath && !IS_PATH_SEP (*--vfs_prefix))
;
if (IS_PATH_SEP (*vfs_prefix))
vfs_prefix++;
*(s - url_delim_len) = '\0';
@ -992,7 +996,7 @@ custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags)
}
}
if (*s == PATH_SEP)
if (IS_PATH_SEP (*s))
break;
s--;
@ -1009,7 +1013,7 @@ custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags)
if (p[3] != 0)
{
if (s == lpath && *s == PATH_SEP)
if (s == lpath && IS_PATH_SEP (*s))
{
/* "/../foo" -> "/foo" */
str_move (s + 1, p + 4);
@ -1034,17 +1038,15 @@ custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags)
if (s == lpath)
{
/* "token/.." -> "." */
if (lpath[0] != PATH_SEP)
{
if (!IS_PATH_SEP (lpath[0]))
lpath[0] = '.';
}
lpath[1] = 0;
lpath[1] = '\0';
}
else
{
/* "foo/token/.." -> "foo" */
if (s == lpath + 1)
s[0] = 0;
s[0] = '\0';
#ifdef HAVE_CHARSET
else if ((strncmp (s, VFS_ENCODING_PREFIX, enc_prefix_len) == 0)
&& (is_supported_encoding (s + enc_prefix_len)))
@ -1055,9 +1057,9 @@ custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags)
s[2] = '\0';
/* search for the previous token */
/* s[-1] == PATH_SEP */
/* IS_PATH_SEP (s[-1]) */
p = s - 1;
while (p >= lpath && *p != PATH_SEP)
while (p >= lpath && !IS_PATH_SEP (*p))
p--;
if (p >= lpath)
@ -1121,9 +1123,8 @@ mc_realpath (const char *path, char *resolved_path)
path = copy_path;
max_path = copy_path + PATH_MAX - 2;
/* If it's a relative pathname use getwd for starters. */
if (*path != '/')
if (!IS_PATH_SEP (*path))
{
new_path = g_get_current_dir ();
if (new_path == NULL)
{
@ -1137,19 +1138,19 @@ mc_realpath (const char *path, char *resolved_path)
}
new_path += strlen (got_path);
if (new_path[-1] != '/')
*new_path++ = '/';
if (!IS_PATH_SEP (new_path[-1]))
*new_path++ = PATH_SEP;
}
else
{
*new_path++ = '/';
*new_path++ = PATH_SEP;
path++;
}
/* Expand each slash-separated pathname component. */
while (*path != '\0')
{
/* Ignore stray "/". */
if (*path == '/')
if (IS_PATH_SEP (*path))
{
path++;
continue;
@ -1157,27 +1158,28 @@ mc_realpath (const char *path, char *resolved_path)
if (*path == '.')
{
/* Ignore ".". */
if (path[1] == '\0' || path[1] == '/')
if (path[1] == '\0' || IS_PATH_SEP (path[1]))
{
path++;
continue;
}
if (path[1] == '.')
{
if (path[2] == '\0' || path[2] == '/')
if (path[2] == '\0' || IS_PATH_SEP (path[2]))
{
path += 2;
/* Ignore ".." at root. */
if (new_path == got_path + 1)
continue;
/* Handle ".." by backing up. */
while ((--new_path)[-1] != '/');
while (!IS_PATH_SEP ((--new_path)[-1]))
;
continue;
}
}
}
/* Safely copy the next pathname component. */
while (*path != '\0' && *path != '/')
while (*path != '\0' && !IS_PATH_SEP (*path))
{
if (path > max_path)
{
@ -1211,12 +1213,13 @@ mc_realpath (const char *path, char *resolved_path)
{
/* Note: readlink doesn't add the null byte. */
link_path[n] = '\0';
if (*link_path == '/')
if (IS_PATH_SEP (*link_path))
/* Start over for an absolute symlink. */
new_path = got_path;
else
/* Otherwise back up over this component. */
while (*(--new_path) != '/');
while (!IS_PATH_SEP (*(--new_path)))
;
/* Safe sex check. */
if (strlen (path) + n >= PATH_MAX - 2)
{
@ -1229,10 +1232,10 @@ mc_realpath (const char *path, char *resolved_path)
path = copy_path;
}
#endif /* S_IFLNK */
*new_path++ = '/';
*new_path++ = PATH_SEP;
}
/* Delete trailing slash but don't whomp a lone slash. */
if (new_path != got_path + 1 && new_path[-1] == '/')
if (new_path != got_path + 1 && IS_PATH_SEP (new_path[-1]))
new_path--;
/* Make sure it's null terminated. */
*new_path = '\0';
@ -1313,7 +1316,7 @@ mc_build_filenamev (const char *first_element, va_list args)
path = g_string_new ("");
absolute = (*first_element != '\0' && *first_element == PATH_SEP);
absolute = IS_PATH_SEP (*first_element);
do
{
@ -1331,10 +1334,10 @@ mc_build_filenamev (const char *first_element, va_list args)
canonicalize_pathname (tmp_element);
len = strlen (tmp_element);
start = (tmp_element[0] == PATH_SEP) ? tmp_element + 1 : tmp_element;
start = IS_PATH_SEP (tmp_element[0]) ? tmp_element + 1 : tmp_element;
g_string_append (path, start);
if (tmp_element[len - 1] != PATH_SEP && element != NULL)
if (!IS_PATH_SEP (tmp_element[len - 1]) && element != NULL)
g_string_append_c (path, PATH_SEP);
g_free (tmp_element);

View File

@ -1,7 +1,7 @@
/*
Directory cache support
Copyright (C) 1998-2014
Copyright (C) 1998-2015
Free Software Foundation, Inc.
Written by:
@ -155,12 +155,14 @@ vfs_s_resolve_symlink (struct vfs_class *me, struct vfs_s_entry *entry, int foll
ERRNOR (EFAULT, NULL);
/* make full path from relative */
if (*linkname != PATH_SEP)
if (!IS_PATH_SEP (*linkname))
{
char *fullpath = vfs_s_fullpath (me, entry->dir);
if (fullpath)
char *fullpath;
fullpath = vfs_s_fullpath (me, entry->dir);
if (fullpath != NULL)
{
fullname = g_strconcat (fullpath, "/", linkname, (char *) NULL);
fullname = g_strconcat (fullpath, PATH_SEP_STR, linkname, (char *) NULL);
linkname = fullname;
g_free (fullpath);
}
@ -193,7 +195,7 @@ vfs_s_find_entry_tree (struct vfs_class *me, struct vfs_s_inode *root,
{
GList *iter;
while (*path == PATH_SEP) /* Strip leading '/' */
while (IS_PATH_SEP (*path)) /* Strip leading '/' */
path++;
if (path[0] == '\0')
@ -202,7 +204,7 @@ vfs_s_find_entry_tree (struct vfs_class *me, struct vfs_s_inode *root,
return ent;
}
for (pseg = 0; path[pseg] != '\0' && path[pseg] != PATH_SEP; pseg++)
for (pseg = 0; path[pseg] != '\0' && !IS_PATH_SEP (path[pseg]); pseg++)
;
for (iter = root->subdir; iter != NULL; iter = g_list_next (iter))
@ -726,7 +728,7 @@ vfs_s_fill_names (struct vfs_class *me, fill_names_f func)
const struct vfs_s_super *super = (const struct vfs_s_super *) iter->data;
char *name;
name = g_strconcat (super->name, "/", me->prefix, VFS_PATH_URL_DELIMITER,
name = g_strconcat (super->name, PATH_SEP_STR, me->prefix, VFS_PATH_URL_DELIMITER,
/* super->current_dir->name, */ (char *) NULL);
func (name);
g_free (name);
@ -1196,7 +1198,7 @@ vfs_s_fullpath (struct vfs_class *me, struct vfs_s_inode *ino)
ino = ino->ent->dir;
if (ino == ino->super->root)
break;
newpath = g_strconcat (ino->ent->name, "/", path, (char *) NULL);
newpath = g_strconcat (ino->ent->name, PATH_SEP_STR, path, (char *) NULL);
g_free (path);
path = newpath;
}

View File

@ -1,7 +1,7 @@
/*
Virtual File System garbage collection code
Copyright (C) 2003-2014
Copyright (C) 2003-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Virtual File System: interface functions
Copyright (C) 2011-2014
Copyright (C) 2011-2015
Free Software Foundation, Inc.
Written by:
@ -710,7 +710,7 @@ mc_chdir (const vfs_path_t * vpath)
char *p;
p = strchr (path_element->path, 0) - 1;
if (*p == PATH_SEP && p > path_element->path)
if (IS_PATH_SEP (*p) && p > path_element->path)
*p = '\0';
}
@ -826,10 +826,8 @@ mc_tmpdir (void)
return tmpdir;
sys_tmp = getenv ("TMPDIR");
if (!sys_tmp || sys_tmp[0] != '/')
{
if (sys_tmp == NULL || !IS_PATH_SEP (sys_tmp[0]))
sys_tmp = TMPDIR_DEFAULT;
}
pwd = getpwuid (getuid ());

View File

@ -1,7 +1,7 @@
/*
Network utilities for the Midnight Commander Virtual File System.
Copyright (C) 1995-2014
Copyright (C) 1995-2015
Free Software Foundation, Inc.
This file is part of the Midnight Commander.

View File

@ -1,7 +1,7 @@
/*
Routines for parsing output from the 'ls' command.
Copyright (C) 1988-2014
Copyright (C) 1988-2015
Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Miguel de Icaza

View File

@ -1,7 +1,7 @@
/*
Virtual File System path handlers
Copyright (C) 2011-2014
Copyright (C) 2011-2015
Free Software Foundation, Inc.
Written by:
@ -139,7 +139,7 @@ vfs_canon (const char *path)
vfs_die ("Cannot canonicalize NULL");
/* Relative to current directory */
if (*path != PATH_SEP)
if (!IS_PATH_SEP (*path))
{
char *result, *local;
@ -198,7 +198,7 @@ vfs_get_encoding (const char *path, ssize_t len)
if (semi == NULL)
return NULL;
if (semi == path || *(semi - 1) == PATH_SEP)
if (semi == path || IS_PATH_SEP (semi[-1]))
{
char *slash;
@ -448,11 +448,11 @@ vfs_path_from_str_uri_parser (char *path, vfs_path_flag_t flags)
char *real_vfs_prefix_start = url_delimiter;
struct vfs_s_subclass *sub = NULL;
while (real_vfs_prefix_start > path && *(real_vfs_prefix_start) != PATH_SEP)
while (real_vfs_prefix_start > path && !IS_PATH_SEP (*real_vfs_prefix_start))
real_vfs_prefix_start--;
vfs_prefix_start = real_vfs_prefix_start;
if (*(vfs_prefix_start) == PATH_SEP)
if (IS_PATH_SEP (*vfs_prefix_start))
vfs_prefix_start += 1;
*url_delimiter = '\0';
@ -495,8 +495,8 @@ vfs_path_from_str_uri_parser (char *path, vfs_path_flag_t flags)
#endif
g_array_prepend_val (vpath->path, element);
if ((real_vfs_prefix_start > path && *(real_vfs_prefix_start) == PATH_SEP) ||
(real_vfs_prefix_start == path && *(real_vfs_prefix_start) != PATH_SEP))
if ((real_vfs_prefix_start > path && IS_PATH_SEP (*real_vfs_prefix_start)) ||
(real_vfs_prefix_start == path && !IS_PATH_SEP (*real_vfs_prefix_start)))
*real_vfs_prefix_start = '\0';
else
*(real_vfs_prefix_start + 1) = '\0';
@ -537,7 +537,7 @@ vfs_path_tokens_add_class_info (const vfs_path_element_t * element, GString * re
{
char *url_str;
if (ret_tokens->len > 0 && ret_tokens->str[ret_tokens->len - 1] != PATH_SEP)
if (ret_tokens->len > 0 && !IS_PATH_SEP (ret_tokens->str[ret_tokens->len - 1]))
g_string_append_c (ret_tokens, PATH_SEP);
g_string_append (ret_tokens, element->vfs_prefix);
@ -556,7 +556,7 @@ vfs_path_tokens_add_class_info (const vfs_path_element_t * element, GString * re
#ifdef HAVE_CHARSET
if (element->encoding != NULL)
{
if (ret_tokens->len > 0 && ret_tokens->str[ret_tokens->len - 1] != PATH_SEP)
if (ret_tokens->len > 0 && !IS_PATH_SEP (ret_tokens->str[ret_tokens->len - 1]))
g_string_append (ret_tokens, PATH_SEP_STR);
g_string_append (ret_tokens, VFS_ENCODING_PREFIX);
g_string_append (ret_tokens, element->encoding);
@ -584,7 +584,7 @@ vfs_path_strip_home (const char *dir)
len = strlen (home_dir);
if (strncmp (dir, home_dir, len) == 0 && (dir[len] == PATH_SEP || dir[len] == '\0'))
if (strncmp (dir, home_dir, len) == 0 && (IS_PATH_SEP (dir[len]) || dir[len] == '\0'))
return g_strdup_printf ("~%s", dir + len);
}
@ -606,8 +606,8 @@ vfs_path_strip_home (const char *dir)
} \
else \
{ \
if ((!is_relative) && (*appendfrom != PATH_SEP) && (*appendfrom != '\0') \
&& (buffer->len == 0 || buffer->str[buffer->len - 1] != PATH_SEP)) \
if (!is_relative && !IS_PATH_SEP (*appendfrom) && *appendfrom != '\0' \
&& (buffer->len == 0 || !IS_PATH_SEP (buffer->str[buffer->len - 1]))) \
g_string_append_c (buffer, PATH_SEP); \
g_string_append (buffer, appendfrom); \
} \
@ -651,7 +651,7 @@ vfs_path_to_str_flags (const vfs_path_t * vpath, int elements_count, vfs_path_fl
if (element->vfs_prefix != NULL)
{
char *url_str;
if ((!is_relative) && (buffer->len == 0 || buffer->str[buffer->len - 1] != PATH_SEP))
if (!is_relative && (buffer->len == 0 || !IS_PATH_SEP (buffer->str[buffer->len - 1])))
g_string_append_c (buffer, PATH_SEP);
g_string_append (buffer, element->vfs_prefix);
@ -674,7 +674,7 @@ vfs_path_to_str_flags (const vfs_path_t * vpath, int elements_count, vfs_path_fl
if ((flags & VPF_HIDE_CHARSET) == 0)
{
if ((!is_relative)
&& (buffer->len == 0 || buffer->str[buffer->len - 1] != PATH_SEP))
&& (buffer->len == 0 || !IS_PATH_SEP (buffer->str[buffer->len - 1])))
g_string_append (buffer, PATH_SEP_STR);
g_string_append (buffer, VFS_ENCODING_PREFIX);
g_string_append (buffer, element->encoding);
@ -1547,7 +1547,7 @@ vfs_path_element_build_pretty_path_str (const vfs_path_element_t * element)
g_string_append (pretty_path, url_params);
g_free (url_params);
if (*element->path != PATH_SEP)
if (!IS_PATH_SEP (*element->path))
g_string_append_c (pretty_path, PATH_SEP);
g_string_append (pretty_path, element->path);

View File

@ -1,7 +1,7 @@
/*
Utilities for VFS modules.
Copyright (C) 1988-2014
Copyright (C) 1988-2015
Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Miguel de Icaza
@ -253,7 +253,7 @@ vfs_url_split (const char *path, int default_port, vfs_url_flags_t flags)
if ((flags & URL_NOSLASH) == 0)
{
/* locate path component */
while (*dir != PATH_SEP && *dir != '\0')
while (!IS_PATH_SEP (*dir) && *dir != '\0')
dir++;
if (*dir == '\0')
path_element->path = g_strdup (PATH_SEP_STR);

View File

@ -1,7 +1,7 @@
/*
Virtual File System switch code
Copyright (C) 1995-2014
Copyright (C) 1995-2015
Free Software Foundation, Inc.
Written by: 1995 Miguel de Icaza
@ -76,7 +76,7 @@ struct vfs_class *current_vfs = NULL;
#define VFS_FIRST_HANDLE 100
#define ISSLASH(a) (!a || (a == '/'))
#define ISSLASH(a) (a == '\0' || IS_PATH_SEP (a))
/*** file scope type declarations ****************************************************************/
@ -121,7 +121,7 @@ _vfs_translate_path (const char *path, int size, GIConv defcnv, GString * buffer
/* try found /#enc: */
semi = g_strrstr_len (path, size, VFS_ENCODING_PREFIX);
if (semi != NULL && (semi == path || *(semi - 1) == PATH_SEP))
if (semi != NULL && (semi == path || IS_PATH_SEP (semi[-1])))
{
char encoding[16];
const char *slash;

View File

@ -1,7 +1,7 @@
/*
Widgets for the Midnight Commander
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Authors:

View File

@ -1,7 +1,7 @@
/*
Widgets for the Midnight Commander
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Authors:

View File

@ -1,7 +1,7 @@
/*
Widgets for the Midnight Commander
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Authors:

View File

@ -3,7 +3,7 @@
Original idea and code: Oleg "Olegarch" Konovalov <olegarch@linuxinside.com>
Copyright (C) 2009-2014
Copyright (C) 2009-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Dialog box features module for the Midnight Commander
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
This file is part of the Midnight Commander.

View File

@ -1,7 +1,7 @@
/*
Widgets for the Midnight Commander
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Authors:

View File

@ -1,7 +1,7 @@
/*
Widgets for the Midnight Commander
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Authors:

View File

@ -1,7 +1,7 @@
/*
Widgets for the Midnight Commander
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Authors:

View File

@ -1,7 +1,7 @@
/*
Widgets for the Midnight Commander
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Authors:

View File

@ -1,7 +1,7 @@
/*
Widgets for the Midnight Commander
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Authors:
@ -684,26 +684,30 @@ input_execute_cmd (WInput * in, unsigned long command)
{
cb_ret_t res = MSG_HANDLED;
/* a highlight command like shift-arrow */
if (command == CK_MarkLeft || command == CK_MarkRight ||
command == CK_MarkToWordBegin || command == CK_MarkToWordEnd ||
command == CK_MarkToHome || command == CK_MarkToEnd)
switch (command)
{
case CK_MarkLeft:
case CK_MarkRight:
case CK_MarkToWordBegin:
case CK_MarkToWordEnd:
case CK_MarkToHome:
case CK_MarkToEnd:
/* a highlight command like shift-arrow */
if (in->mark < 0)
{
input_mark_cmd (in, FALSE); /* clear */
input_mark_cmd (in, TRUE); /* marking on */
}
}
switch (command)
{
break;
case CK_WordRight:
case CK_WordLeft:
case CK_Right:
case CK_Left:
if (in->mark >= 0)
input_mark_cmd (in, FALSE);
break;
default:
break;
}
switch (command)
@ -807,10 +811,20 @@ input_execute_cmd (WInput * in, unsigned long command)
res = MSG_NOT_HANDLED;
}
if (command != CK_MarkLeft && command != CK_MarkRight &&
command != CK_MarkToWordBegin && command != CK_MarkToWordEnd &&
command != CK_MarkToHome && command != CK_MarkToEnd)
switch (command)
{
case CK_MarkLeft:
case CK_MarkRight:
case CK_MarkToWordBegin:
case CK_MarkToWordEnd:
case CK_MarkToHome:
case CK_MarkToEnd:
/* do nothing */
break;
default:
in->mark = -1;
break;
}
return res;
}

View File

@ -2,7 +2,7 @@
Input line filename/username/hostname/variable/command completion.
(Let mc type for you...)
Copyright (C) 1995-2014
Copyright (C) 1995-2015
Free Software Foundation, Inc.
Written by:
@ -288,7 +288,7 @@ filename_completion_function (const char *text, int state, input_complete_t flag
g_string_append (temp, users_dirname);
/* We need a '/' at the end. */
if (temp->str[temp->len - 1] != PATH_SEP)
if (!IS_PATH_SEP (temp->str[temp->len - 1]))
g_string_append_c (temp, PATH_SEP);
}
g_string_append (temp, entry->d_name);
@ -909,7 +909,7 @@ try_complete_all_possible (try_complete_automation_state_t * state, char *text,
SHOW_C_CTX ("try_complete:filename_subst_1");
matches = completion_matches (state->word, filename_completion_function, state->flags);
if (matches == NULL && state->is_cd && *state->word != PATH_SEP && *state->word != '~')
if (matches == NULL && state->is_cd && !IS_PATH_SEP (*state->word) && *state->word != '~')
{
state->q = text + *lc_start;
for (state->p = text;

View File

@ -1,7 +1,7 @@
/*
Widgets for the Midnight Commander
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Authors:

View File

@ -1,7 +1,7 @@
/*
Widget based utility functions.
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Authors:

View File

@ -1,7 +1,7 @@
/*
Widgets for the Midnight Commander
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Authors:

View File

@ -1,7 +1,7 @@
/*
Pulldown menu code
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Written by:

View File

@ -1,7 +1,7 @@
/*
Widget based utility functions.
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Authors:

View File

@ -1,7 +1,7 @@
/*
Widgets for the Midnight Commander
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Authors:

View File

@ -1,7 +1,7 @@
/*
Widgets for the Midnight Commander
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Authors:

View File

@ -1,7 +1,7 @@
/*
Widget based utility functions.
Copyright (C) 1994-2014
Copyright (C) 1994-2015
Free Software Foundation, Inc.
Authors:

View File

@ -8,12 +8,12 @@ AC_DEFUN([AC_G_MODULE_SUPPORTED], [
g_module_supported=""
found_gmodule=no
PKG_CHECK_MODULES(GMODULE, [gmodule-no-export-2.0 >= 2.12], [found_gmodule=yes], [:])
PKG_CHECK_MODULES(GMODULE, [gmodule-no-export-2.0 >= 2.14], [found_gmodule=yes], [:])
if test x"$found_gmodule" = xyes; then
g_module_supported="gmodule-no-export-2.0"
else
dnl try fallback to the generic gmodule
PKG_CHECK_MODULES(GMODULE, [gmodule-2.0 >= 2.12], [found_gmodule=yes], [:])
PKG_CHECK_MODULES(GMODULE, [gmodule-2.0 >= 2.14], [found_gmodule=yes], [:])
if test x"$found_gmodule" = xyes; then
g_module_supported="gmodule-2.0"
fi
@ -78,9 +78,9 @@ AC_DEFUN([AC_CHECK_GLIB], [
AS_HELP_STRING([--with-glib-static], [Link glib statically @<:@no@:>@]))
glib_found=no
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.12], [glib_found=yes], [:])
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.14], [glib_found=yes], [:])
if test x"$glib_found" = xno; then
AC_MSG_ERROR([glib-2.0 not found or version too old (must be >= 2.12)])
AC_MSG_ERROR([glib-2.0 not found or version too old (must be >= 2.14)])
fi
])

View File

@ -461,7 +461,7 @@ m view `man'
MAN=%{Enter name of man:}
%view{ascii,nroff} MANROFFOPT='@MAN_FLAGS@' MAN_KEEP_FORMATTING=1 man -P cat $MAN
i Insert a out of command to cursor.
i Insert output of command to cursor
CMD=%{ Enter command: }
eval $CMD > %b

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Midnight Commander\n"
"Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n"
"POT-Creation-Date: 2015-02-17 15:19+0300\n"
"POT-Creation-Date: 2015-02-26 09:43+0300\n"
"PO-Revision-Date: 2014-09-04 10:10+0000\n"
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
"Language-Team: Azerbaijani (http://www.transifex.com/projects/p/mc/language/"
@ -712,6 +712,12 @@ msgstr ""
msgid "Two files are required to evoke the diffviewer."
msgstr ""
msgid "Background protocol error"
msgstr ""
msgid "Reading failed"
msgstr ""
msgid "Background process error"
msgstr ""
@ -721,12 +727,6 @@ msgstr ""
msgid "Child died unexpectedly"
msgstr ""
msgid "Background protocol error"
msgstr ""
msgid "Reading failed"
msgstr ""
msgid ""
"Background process sent us a request for more arguments\n"
"than we can handle."
@ -1498,7 +1498,7 @@ msgid ""
"written for the Midnight Commander."
msgstr ""
msgid "Copyright (C) 1996-2014 the Free Software Foundation"
msgid "Copyright (C) 1996-2015 the Free Software Foundation"
msgstr ""
msgid "About"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Midnight Commander\n"
"Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n"
"POT-Creation-Date: 2015-02-17 15:19+0300\n"
"POT-Creation-Date: 2015-02-26 09:43+0300\n"
"PO-Revision-Date: 2014-09-04 10:10+0000\n"
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
"Language-Team: Belarusian (http://www.transifex.com/projects/p/mc/language/"
@ -744,6 +744,12 @@ msgstr "Праглядніку не перадалі довадаў."
msgid "Two files are required to evoke the diffviewer."
msgstr "Каб выклікаць праґраму параўнаньня, трэба два файлы."
msgid "Background protocol error"
msgstr "Даў хібу пратакол на тле"
msgid "Reading failed"
msgstr "Не ўдалося прачытаць"
msgid "Background process error"
msgstr "Даў хібу працэс на тле"
@ -753,12 +759,6 @@ msgstr "Невядомая памылка ў даччыным працэсе"
msgid "Child died unexpectedly"
msgstr "Даччыны працэс неспадзявана памёр"
msgid "Background protocol error"
msgstr "Даў хібу пратакол на тле"
msgid "Reading failed"
msgstr "Не ўдалося прачытаць"
msgid ""
"Background process sent us a request for more arguments\n"
"than we can handle."
@ -1551,7 +1551,7 @@ msgid ""
"written for the Midnight Commander."
msgstr ""
msgid "Copyright (C) 1996-2014 the Free Software Foundation"
msgid "Copyright (C) 1996-2015 the Free Software Foundation"
msgstr ""
msgid "About"

View File

@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Midnight Commander\n"
"Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n"
"POT-Creation-Date: 2015-02-17 15:19+0300\n"
"POT-Creation-Date: 2015-02-26 09:43+0300\n"
"PO-Revision-Date: 2014-09-04 10:10+0000\n"
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
"Language-Team: Bulgarian (http://www.transifex.com/projects/p/mc/language/"
@ -713,6 +713,12 @@ msgstr ""
msgid "Two files are required to evoke the diffviewer."
msgstr ""
msgid "Background protocol error"
msgstr ""
msgid "Reading failed"
msgstr "Грешка при четене"
msgid "Background process error"
msgstr "Грешка във фоновия процес"
@ -722,12 +728,6 @@ msgstr "Непозната грешка в дъщерния процес"
msgid "Child died unexpectedly"
msgstr "Дъщерният процес приключи неочаквано"
msgid "Background protocol error"
msgstr ""
msgid "Reading failed"
msgstr "Грешка при четене"
msgid ""
"Background process sent us a request for more arguments\n"
"than we can handle."
@ -1499,7 +1499,7 @@ msgid ""
"written for the Midnight Commander."
msgstr ""
msgid "Copyright (C) 1996-2014 the Free Software Foundation"
msgid "Copyright (C) 1996-2015 the Free Software Foundation"
msgstr ""
msgid "About"

View File

@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Midnight Commander\n"
"Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n"
"POT-Creation-Date: 2015-02-17 15:19+0300\n"
"POT-Creation-Date: 2015-02-26 09:43+0300\n"
"PO-Revision-Date: 2014-09-04 10:10+0000\n"
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
"Language-Team: Catalan (http://www.transifex.com/projects/p/mc/language/"
@ -718,6 +718,12 @@ msgstr ""
msgid "Two files are required to evoke the diffviewer."
msgstr ""
msgid "Background protocol error"
msgstr ""
msgid "Reading failed"
msgstr ""
msgid "Background process error"
msgstr ""
@ -727,12 +733,6 @@ msgstr ""
msgid "Child died unexpectedly"
msgstr ""
msgid "Background protocol error"
msgstr ""
msgid "Reading failed"
msgstr ""
msgid ""
"Background process sent us a request for more arguments\n"
"than we can handle."
@ -1504,7 +1504,7 @@ msgid ""
"written for the Midnight Commander."
msgstr ""
msgid "Copyright (C) 1996-2014 the Free Software Foundation"
msgid "Copyright (C) 1996-2015 the Free Software Foundation"
msgstr ""
msgid "About"

View File

@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Midnight Commander\n"
"Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n"
"POT-Creation-Date: 2015-02-17 15:19+0300\n"
"POT-Creation-Date: 2015-02-26 09:43+0300\n"
"PO-Revision-Date: 2014-09-04 10:10+0000\n"
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
"Language-Team: Czech (http://www.transifex.com/projects/p/mc/language/cs/)\n"
@ -739,6 +739,12 @@ msgstr "Prohlížeči nebyly zadány žádné parametry"
msgid "Two files are required to evoke the diffviewer."
msgstr "Dva soubory jsou potřeba k vyvolání prohlížeče změn"
msgid "Background protocol error"
msgstr "Chyba protokolu na pozadí"
msgid "Reading failed"
msgstr "Čtení selhalo"
msgid "Background process error"
msgstr "Chyba procesu na pozadí"
@ -748,12 +754,6 @@ msgstr "Neznámá chyba v potomku procesu"
msgid "Child died unexpectedly"
msgstr "Potomek procesu neočekávaně umřel"
msgid "Background protocol error"
msgstr "Chyba protokolu na pozadí"
msgid "Reading failed"
msgstr "Čtení selhalo"
msgid ""
"Background process sent us a request for more arguments\n"
"than we can handle."
@ -1540,7 +1540,7 @@ msgid ""
"written for the Midnight Commander."
msgstr ""
msgid "Copyright (C) 1996-2014 the Free Software Foundation"
msgid "Copyright (C) 1996-2015 the Free Software Foundation"
msgstr ""
msgid "About"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Midnight Commander\n"
"Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n"
"POT-Creation-Date: 2015-02-17 15:19+0300\n"
"POT-Creation-Date: 2015-02-26 09:43+0300\n"
"PO-Revision-Date: 2014-09-04 10:10+0000\n"
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
"Language-Team: Danish (http://www.transifex.com/projects/p/mc/language/da/)\n"
@ -720,6 +720,12 @@ msgstr "Ingen argumenter givet til fremviseren."
msgid "Two files are required to evoke the diffviewer."
msgstr "To filer kræves for at vække forskelsfremviseren."
msgid "Background protocol error"
msgstr "Fejl i baggrundsprotokol"
msgid "Reading failed"
msgstr "Læsning fejlede"
msgid "Background process error"
msgstr "Fejl i baggrundsproces"
@ -729,12 +735,6 @@ msgstr "Ukendt fejl i underproces"
msgid "Child died unexpectedly"
msgstr "Underproces døde uventet"
msgid "Background protocol error"
msgstr "Fejl i baggrundsprotokol"
msgid "Reading failed"
msgstr "Læsning fejlede"
msgid ""
"Background process sent us a request for more arguments\n"
"than we can handle."
@ -1521,7 +1521,7 @@ msgid ""
"written for the Midnight Commander."
msgstr ""
msgid "Copyright (C) 1996-2014 the Free Software Foundation"
msgid "Copyright (C) 1996-2015 the Free Software Foundation"
msgstr ""
msgid "About"

View File

@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Midnight Commander\n"
"Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n"
"POT-Creation-Date: 2015-02-17 15:19+0300\n"
"POT-Creation-Date: 2015-02-26 09:43+0300\n"
"PO-Revision-Date: 2014-09-04 10:10+0000\n"
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
"Language-Team: German (http://www.transifex.com/projects/p/mc/language/de/)\n"
@ -724,6 +724,12 @@ msgstr "Keine Argumente an den Viewer übergeben."
msgid "Two files are required to evoke the diffviewer."
msgstr "2 Dateien werden benötigt, um den Diffviewer aufzurufen."
msgid "Background protocol error"
msgstr "Fehler im Hintergrundprotokoll"
msgid "Reading failed"
msgstr "Fehler beim Lesen"
msgid "Background process error"
msgstr "Fehler im Hintergrundprozess"
@ -733,12 +739,6 @@ msgstr "Unbekannter Fehler im Kindprozess"
msgid "Child died unexpectedly"
msgstr "Kindprozess starb unerwartet"
msgid "Background protocol error"
msgstr "Fehler im Hintergrundprotokoll"
msgid "Reading failed"
msgstr "Fehler beim Lesen"
msgid ""
"Background process sent us a request for more arguments\n"
"than we can handle."
@ -1528,7 +1528,7 @@ msgstr ""
"Ein benutzerfreundlicher Texteditor\n"
"geschrieben für Midnight Commander."
msgid "Copyright (C) 1996-2014 the Free Software Foundation"
msgid "Copyright (C) 1996-2015 the Free Software Foundation"
msgstr ""
msgid "About"

Some files were not shown because too many files have changed in this diff Show More