From 5e778f7c8d1ecf3d8f11385db013af2ba026e2a5 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 22 Aug 2009 18:56:06 +0200 Subject: global: convert indentation-TABs to spaces Transformed via this shell code: t=$'\t' git ls-files \ | grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \ | grep -vE 'tests/pr/|help2man' \ | xargs grep -lE "^ *$t" \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_' --- lib/euidaccess-stat.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'lib/euidaccess-stat.c') diff --git a/lib/euidaccess-stat.c b/lib/euidaccess-stat.c index 0213c93fc..98ce28157 100644 --- a/lib/euidaccess-stat.c +++ b/lib/euidaccess-stat.c @@ -57,8 +57,8 @@ euidaccess_stat (struct stat const *st, int mode) mode &= 7; else mode = ((mode & R_OK ? 4 : 0) - + (mode & W_OK ? 2 : 0) - + (mode & X_OK ? 1 : 0)); + + (mode & W_OK ? 2 : 0) + + (mode & X_OK ? 1 : 0)); if (mode == 0) return true; /* The file exists. */ @@ -68,7 +68,7 @@ euidaccess_stat (struct stat const *st, int mode) /* The super-user can read and write any file, and execute any file that anyone can execute. */ if (euid == 0 && ((mode & X_OK) == 0 - || (st->st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))) + || (st->st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))) return true; /* Convert the file's permission bits to traditional form. */ @@ -84,14 +84,14 @@ euidaccess_stat (struct stat const *st, int mode) granted = st->st_mode; else granted = ( (st->st_mode & S_IRUSR ? 4 << 6 : 0) - + (st->st_mode & S_IWUSR ? 2 << 6 : 0) - + (st->st_mode & S_IXUSR ? 1 << 6 : 0) - + (st->st_mode & S_IRGRP ? 4 << 3 : 0) - + (st->st_mode & S_IWGRP ? 2 << 3 : 0) - + (st->st_mode & S_IXGRP ? 1 << 3 : 0) - + (st->st_mode & S_IROTH ? 4 << 0 : 0) - + (st->st_mode & S_IWOTH ? 2 << 0 : 0) - + (st->st_mode & S_IXOTH ? 1 << 0 : 0)); + + (st->st_mode & S_IWUSR ? 2 << 6 : 0) + + (st->st_mode & S_IXUSR ? 1 << 6 : 0) + + (st->st_mode & S_IRGRP ? 4 << 3 : 0) + + (st->st_mode & S_IWGRP ? 2 << 3 : 0) + + (st->st_mode & S_IXGRP ? 1 << 3 : 0) + + (st->st_mode & S_IROTH ? 4 << 0 : 0) + + (st->st_mode & S_IWOTH ? 2 << 0 : 0) + + (st->st_mode & S_IXOTH ? 1 << 0 : 0)); if (euid == st->st_uid) granted >>= 6; @@ -99,7 +99,7 @@ euidaccess_stat (struct stat const *st, int mode) { gid_t egid = getegid (); if (egid == st->st_gid || group_member (st->st_gid)) - granted >>= 3; + granted >>= 3; } if ((mode & ~granted) == 0) -- cgit v1.2.3-54-g00ecf