diff --git a/ChangeLog b/ChangeLog index 5a7ec89e5..cbdd5bb3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-04-30 Andrej Borsenkow + + * Bart: 14144 (modified): Src/Modules/stat.c + The S_IXUSR, S_IXGRP, S_IXOTH are made external variables in + Cygwin 1.3.1 and cannot be used as static array initializer + anymore. + 2001-04-29 Bart Schaefer * users/3837: Completion/compinit: Add `NO_kshglob' to diff --git a/Src/Modules/stat.c b/Src/Modules/stat.c index d0f80829c..053d0ace0 100644 --- a/Src/Modules/stat.c +++ b/Src/Modules/stat.c @@ -54,13 +54,33 @@ statmodeprint(mode_t mode, char *outbuf, int flags) } if (flags & STF_STRING) { static const char *modes = "?rwxrwxrwx"; - static const mode_t mflags[] = { S_IRUSR, S_IWUSR, S_IXUSR, - S_IRGRP, S_IWGRP, S_IXGRP, - S_IROTH, S_IWOTH, S_IXOTH }; + static const mode_t mflags[9] = { +#ifdef __CYGWIN__ + 0 +#else + S_IRUSR, S_IWUSR, S_IXUSR, + S_IRGRP, S_IWGRP, S_IXGRP, + S_IROTH, S_IWOTH, S_IXOTH +#endif + }; const mode_t *mfp = mflags; char pm[11]; int i; +#ifdef __CYGWIN__ + if (mflags[0] == 0) { + mflags[0] = S_IRUSR; + mflags[1] = S_IWUSR; + mflags[2] = S_IXUSR; + mflags[3] = S_IRGRP; + mflags[4] = S_IWGRP; + mflags[5] = S_IXGRP; + mflags[6] = S_IROTH; + mflags[7] = S_IWOTH; + mflags[8] = S_IXOTH; + } +#endif + if (S_ISBLK(mode)) *pm = 'b'; else if (S_ISCHR(mode))