Author: delphij
Date: Mon Apr  3 06:13:05 2017
New Revision: 316441
URL: https://svnweb.freebsd.org/changeset/base/316441

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/11/usr.bin/sed/main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/sed/main.c
==============================================================================
--- stable/11/usr.bin/sed/main.c        Mon Apr  3 06:09:12 2017        
(r316440)
+++ stable/11/usr.bin/sed/main.c        Mon Apr  3 06:13:05 2017        
(r316441)
@@ -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"

Reply via email to