diff --git a/src/ChangeLog b/src/ChangeLog index 64706d038..342333f68 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +Thu Jan 14 13:18:58 1999 Timur Bakeyev + + * screen.c (string_file_[owner|group]): Workaround the fact, that some + systems have user and group names greater than 8 symbols. Now we trun- + cate them. + 1999-01-13 Federico Mena Quintero * treestore.c (tree_store_load): Use g_return_val_if_fail(), not diff --git a/src/screen.c b/src/screen.c index a8a2bd33a..3f709684d 100644 --- a/src/screen.c +++ b/src/screen.c @@ -29,6 +29,9 @@ #ifdef HAVE_UNISTD_H # include /* For chdir(), readlink() and getwd()/getcwd() */ #endif + +#include "mc.h" + #include "mem.h" #include "mad.h" #include "global.h" @@ -52,7 +55,6 @@ #include "widget.h" #include "../vfs/vfs.h" #include "../vfs/extfs.h" -#include #ifdef NEEDS_DRIVE_H # include "drive.h" @@ -276,18 +278,6 @@ string_file_nlinks (file_entry *fe, int len) return buffer; } -char * -string_file_owner (file_entry *fe, int len) -{ - return get_owner (fe->buf.st_uid); -} - -char * -string_file_group (file_entry *fe, int len) -{ - return get_group (fe->buf.st_gid); -} - char * string_file_size (file_entry *fe, int len) { @@ -335,12 +325,42 @@ string_file_ctime (file_entry *fe, int len) #ifdef HAVE_GNOME /* In GNOME, the CList truncates the names */ +char * +string_file_owner (file_entry *fe, int len) +{ + return get_owner (fe->buf.st_uid); +} + +char * +string_file_group (file_entry *fe, int len) +{ + return get_group (fe->buf.st_gid); +} + char * string_file_name (file_entry *fe, int len) { return fe->fname; } #else +char * +string_file_owner (file_entry *fe, int len) +{ + if (len) + return name_trunc (get_owner (fe->buf.st_uid), len); + else + return get_owner (fe->buf.st_uid); +} + +char * +string_file_group (file_entry *fe, int len) +{ + if (len) + return name_trunc (get_group (fe->buf.st_gid), len); + else + return get_group (fe->buf.st_gid); +} + char * string_file_name (file_entry *fe, int len) {