mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Use str_trunc() directly instead of name_trunc().
name_trunc(): removed. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
53ad349a36
commit
d169d13296
15
lib/util.c
15
lib/util.c
@ -393,20 +393,7 @@ fake_name_quote (const char *s, int quote_percent)
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/**
|
||||
* Remove the middle part of the string to fit given length.
|
||||
* Use "~" to show where the string was truncated.
|
||||
* Return static buffer, no need to free() it.
|
||||
*/
|
||||
|
||||
const char *
|
||||
name_trunc (const char *txt, size_t trunc_len)
|
||||
{
|
||||
return str_trunc (txt, trunc_len);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/**
|
||||
* path_trunc() is the same as name_trunc() above but
|
||||
* path_trunc() is the same as str_trunc() but
|
||||
* it deletes possible password from path for security
|
||||
* reasons.
|
||||
*/
|
||||
|
@ -115,12 +115,7 @@ char *name_quote (const char *c, int quote_percent);
|
||||
/* returns a duplicate of c. */
|
||||
char *fake_name_quote (const char *c, int quote_percent);
|
||||
|
||||
/* Remove the middle part of the string to fit given length.
|
||||
* Use "~" to show where the string was truncated.
|
||||
* Return static buffer, no need to free() it. */
|
||||
const char *name_trunc (const char *txt, size_t trunc_len);
|
||||
|
||||
/* path_trunc() is the same as name_trunc() above but
|
||||
/* path_trunc() is the same as str_trunc() but
|
||||
* it deletes possible password from path for security
|
||||
* reasons. */
|
||||
const char *path_trunc (const char *path, size_t trunc_len);
|
||||
|
@ -81,7 +81,7 @@ static int c_file, end_chmod;
|
||||
|
||||
static mode_t and_mask, or_mask, c_stat;
|
||||
|
||||
/* FIXME: these variables are superfluous, aren't they? (hint: name_trunc
|
||||
/* FIXME: these variables are superfluous, aren't they? (hint: str_trunc
|
||||
* returns a pointer to a static buffer, and label_new creates its own copy
|
||||
* of its argument)
|
||||
* --rillig, 2004-08-29 */
|
||||
|
@ -1604,7 +1604,7 @@ compute_dir_size_update_ui (const void *ui, const char *dirname)
|
||||
if (ui == NULL)
|
||||
return FILE_CONT;
|
||||
|
||||
label_set_text (this->dirname, name_trunc (dirname, this->dlg->cols - 6));
|
||||
label_set_text (this->dirname, str_trunc (dirname, this->dlg->cols - 6));
|
||||
|
||||
event.x = -1; /* Don't show the GPM cursor */
|
||||
c = tty_get_event (&event, FALSE, FALSE);
|
||||
|
Loading…
Reference in New Issue
Block a user