svn commit: r316442 - stable/10/usr.bin/sed
Xin LI
delphij at FreeBSD.org
Mon Apr 3 06:14:24 UTC 2017
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");
More information about the svn-src-stable
mailing list