* screen.c (string_file_size): Don't display size of ".." - it

may take too much time to calculate it on VFS.  Show "UP--DIR"
instead.
(string_file_size_brief): Remove ".." handling - it's now done
in string_file_size().  Show "SUB-DIR" for links to directories,
"SYMLINK" for other links.
This commit is contained in:
Pavel Roskin 2002-01-20 19:52:11 +00:00
parent adce2a295d
commit 894ed9dcc6
2 changed files with 22 additions and 2 deletions

View File

@ -1,3 +1,12 @@
2002-01-20 Pavel Roskin <proski@gnu.org>
* screen.c (string_file_size): Don't display size of ".." - it
may take too much time to calculate it on VFS. Show "UP--DIR"
instead.
(string_file_size_brief): Remove ".." handling - it's now done
in string_file_size(). Show "SUB-DIR" for links to directories,
"SYMLINK" for other links.
2002-01-17 Pavel Roskin <proski@gnu.org>
* cmd.c: Remove OS/2 specific code.

View File

@ -172,6 +172,12 @@ string_file_size (file_entry *fe, int len)
{
static char buffer [BUF_TINY];
/* Don't ever show size of ".." since we don't calculate it */
if (!strcmp (fe->fname, "..")) {
strcpy (buffer, N_("UP--DIR"));
return buffer;
}
#ifdef HAVE_ST_RDEV
if (S_ISBLK (fe->buf.st_mode) || S_ISCHR (fe->buf.st_mode))
g_snprintf (buffer, sizeof (buffer), "%3d,%3d",
@ -191,8 +197,13 @@ string_file_size_brief (file_entry *fe, int len)
{
static char buffer [BUF_TINY];
if (S_ISDIR (fe->buf.st_mode)){
strcpy (buffer, _(strcmp (fe->fname, "..") ? N_("SUB-DIR") : N_("UP--DIR")));
if (S_ISLNK (fe->buf.st_mode) && !fe->f.link_to_dir) {
strcpy (buffer, N_("SYMLINK"));
return buffer;
}
if ((S_ISDIR (fe->buf.st_mode) || fe->f.link_to_dir) && strcmp (fe->fname, "..")) {
strcpy (buffer, N_("SUB-DIR"));
return buffer;
}