On Fri, Jun 08, 2007 at 01:11:17PM -0400, Charles Wilson wrote: > if ((stat (path, &st) >= 0) && ( > - /* MinGW & native WIN32 do not support > S_IXOTH or S_IXGRP */ > -#if defined (S_IXOTH) > - ((st.st_mode & S_IXOTH) == S_IXOTH) || > -#endif > -#if defined (S_IXGRP) > - ((st.st_mode & S_IXGRP) == S_IXGRP) || > -#endif > + ((S_IXOTH != 0) && ((st.st_mode & S_IXOTH) > == S_IXOTH)) || > + ((S_IXGRP != 0) && ((st.st_mode & S_IXGRP) > == S_IXGRP)) || > ((st.st_mode & S_IXUSR) == S_IXUSR)))
You can write this more simply: if (stat (path, &st) >= 0 && st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) (Or even `access (path, X_OK) == 0', if MSYS has that.) The rest looks good to me. Thank you.