Restore r312404:
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>. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D4827
This commit is contained in:
parent
7664382295
commit
8e2106f0cb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=313277
@ -391,7 +391,7 @@ mf_fgets(SPACE *sp, enum e_spflag spflag)
|
|||||||
if (inplace != NULL) {
|
if (inplace != NULL) {
|
||||||
if (lstat(fname, &sb) != 0)
|
if (lstat(fname, &sb) != 0)
|
||||||
err(1, "%s", fname);
|
err(1, "%s", fname);
|
||||||
if (!(sb.st_mode & S_IFREG))
|
if (!S_ISREG(sb.st_mode))
|
||||||
errx(1, "%s: %s %s", fname,
|
errx(1, "%s: %s %s", fname,
|
||||||
"in-place editing only",
|
"in-place editing only",
|
||||||
"works for regular files");
|
"works for regular files");
|
||||||
|
Loading…
Reference in New Issue
Block a user