remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 1999 - 2002 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of KTH nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
@@ -152,10 +152,10 @@ make_fileinfo(FILE *out, const char *filename, struct fileinfo *file, int flags)
|
||||
char buf[128];
|
||||
int file_type = 0;
|
||||
struct stat *st = &file->st;
|
||||
|
||||
|
||||
file->inode = st->st_ino;
|
||||
file->bsize = block_convert(st->st_blocks);
|
||||
|
||||
|
||||
if(S_ISDIR(st->st_mode)) {
|
||||
file->mode[0] = 'd';
|
||||
file_type = '/';
|
||||
@@ -187,10 +187,10 @@ make_fileinfo(FILE *out, const char *filename, struct fileinfo *file, int flags)
|
||||
file_type = '%';
|
||||
}
|
||||
#endif
|
||||
else
|
||||
else
|
||||
file->mode[0] = '?';
|
||||
{
|
||||
char *x[] = { "---", "--x", "-w-", "-wx",
|
||||
char *x[] = { "---", "--x", "-w-", "-wx",
|
||||
"r--", "r-x", "rw-", "rwx" };
|
||||
strcpy(file->mode + 1, x[(st->st_mode & S_IRWXU) >> 6]);
|
||||
strcpy(file->mode + 4, x[(st->st_mode & S_IRWXG) >> 3]);
|
||||
@@ -241,7 +241,7 @@ make_fileinfo(FILE *out, const char *filename, struct fileinfo *file, int flags)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) {
|
||||
#if defined(major) && defined(minor)
|
||||
if (asprintf(&file->major, "%u", (unsigned)major(st->st_rdev)) == -1)
|
||||
@@ -414,7 +414,7 @@ lstat_file (const char *file, struct stat *sb)
|
||||
{
|
||||
#ifdef KRB4
|
||||
if (do_the_afs_dance &&
|
||||
k_hasafs()
|
||||
k_hasafs()
|
||||
&& strcmp(file, ".")
|
||||
&& strcmp(file, "..")
|
||||
&& strcmp(file, "/"))
|
||||
@@ -431,7 +431,7 @@ lstat_file (const char *file, struct stat *sb)
|
||||
return -1;
|
||||
|
||||
a_params.out = malloc (maxsize);
|
||||
if (a_params.out == NULL) {
|
||||
if (a_params.out == NULL) {
|
||||
free (path_bkp);
|
||||
return -1;
|
||||
}
|
||||
@@ -473,7 +473,7 @@ lstat_file (const char *file, struct stat *sb)
|
||||
return lstat (file, sb);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* wow this was a mountpoint, lets cook the struct stat
|
||||
* use . as a prototype
|
||||
*/
|
||||
@@ -551,15 +551,15 @@ list_files(FILE *out, const char **files, int n_files, int flags)
|
||||
}
|
||||
switch(SORT_MODE(flags)) {
|
||||
case LS_SORT_NAME:
|
||||
qsort(fi, n_files, sizeof(*fi),
|
||||
qsort(fi, n_files, sizeof(*fi),
|
||||
(int (*)(const void*, const void*))compare_filename);
|
||||
break;
|
||||
case LS_SORT_MTIME:
|
||||
qsort(fi, n_files, sizeof(*fi),
|
||||
qsort(fi, n_files, sizeof(*fi),
|
||||
(int (*)(const void*, const void*))compare_mtime);
|
||||
break;
|
||||
case LS_SORT_SIZE:
|
||||
qsort(fi, n_files, sizeof(*fi),
|
||||
qsort(fi, n_files, sizeof(*fi),
|
||||
(int (*)(const void*, const void*))compare_size);
|
||||
break;
|
||||
}
|
||||
@@ -633,7 +633,7 @@ list_files(FILE *out, const char **files, int n_files, int flags)
|
||||
max_major,
|
||||
max_minor,
|
||||
max_date);
|
||||
} else if(DISP_MODE(flags) == LS_DISP_COLUMN ||
|
||||
} else if(DISP_MODE(flags) == LS_DISP_COLUMN ||
|
||||
DISP_MODE(flags) == LS_DISP_CROSS) {
|
||||
int max_len = 0;
|
||||
int size_len = 0;
|
||||
@@ -660,14 +660,14 @@ list_files(FILE *out, const char **files, int n_files, int flags)
|
||||
max_len = 80 / columns;
|
||||
}
|
||||
if(flags & LS_SIZE)
|
||||
sec_fprintf2(out, "total %lu\r\n",
|
||||
sec_fprintf2(out, "total %lu\r\n",
|
||||
(unsigned long)total_blocks);
|
||||
if(DISP_MODE(flags) == LS_DISP_CROSS) {
|
||||
for(i = 0, j = 0; i < n_files; i++) {
|
||||
if(fi[i].filename == NULL)
|
||||
continue;
|
||||
if(flags & LS_SIZE)
|
||||
sec_fprintf2(out, "%*u %-*s", size_len, fi[i].bsize,
|
||||
sec_fprintf2(out, "%*u %-*s", size_len, fi[i].bsize,
|
||||
max_len, fi[i].filename);
|
||||
else
|
||||
sec_fprintf2(out, "%-*s", max_len, fi[i].filename);
|
||||
@@ -687,7 +687,7 @@ list_files(FILE *out, const char **files, int n_files, int flags)
|
||||
while(j < n_files && fi[j].filename == NULL)
|
||||
j++;
|
||||
if(flags & LS_SIZE)
|
||||
sec_fprintf2(out, "%*u %-*s", size_len, fi[j].bsize,
|
||||
sec_fprintf2(out, "%*u %-*s", size_len, fi[j].bsize,
|
||||
max_len, fi[j].filename);
|
||||
else
|
||||
sec_fprintf2(out, "%-*s", max_len, fi[j].filename);
|
||||
@@ -710,7 +710,7 @@ list_files(FILE *out, const char **files, int n_files, int flags)
|
||||
const char *p = strrchr(files[i], '/');
|
||||
if(p == NULL)
|
||||
p = files[i];
|
||||
else
|
||||
else
|
||||
p++;
|
||||
if(!(flags & LS_DIR_FLAG) || !IS_DOT_DOTDOT(p)) {
|
||||
if((flags & LS_SHOW_DIRNAME)) {
|
||||
|
Reference in New Issue
Block a user