Author: delphij Date: Mon Apr 3 06:14:23 2017 New Revision: 316442 URL: https://svnweb.freebsd.org/changeset/base/316442
Log: MFC r312404, r312519, r313277: Use S_ISREG instead of manual & (also it's better to compare the result from & and the pattern instead of just assuming it's one bit value). Pointed out by Tianjie Mao <tjmao tjmao com>. Modified: stable/10/usr.bin/sed/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/sed/main.c ============================================================================== --- stable/10/usr.bin/sed/main.c Mon Apr 3 06:13:05 2017 (r316441) +++ stable/10/usr.bin/sed/main.c Mon Apr 3 06:14:23 2017 (r316442) @@ -391,7 +391,7 @@ mf_fgets(SPACE *sp, enum e_spflag spflag if (inplace != NULL) { if (lstat(fname, &sb) != 0) err(1, "%s", fname); - if (!(sb.st_mode & S_IFREG)) + if (!S_ISREG(sb.st_mode)) errx(1, "%s: %s %s", fname, "in-place editing only", "works for regular files"); _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"