Author: pfg
Date: Tue Jan 27 19:46:19 2015
New Revision: 277811
URL: https://svnweb.freebsd.org/changeset/base/277811

Log:
  sed: fix pasto from previous r277802.
  
  MFC after:    3 days

Modified:
  head/usr.bin/sed/main.c

Modified: head/usr.bin/sed/main.c
==============================================================================
--- head/usr.bin/sed/main.c     Tue Jan 27 19:41:24 2015        (r277810)
+++ head/usr.bin/sed/main.c     Tue Jan 27 19:46:19 2015        (r277811)
@@ -409,10 +409,10 @@ mf_fgets(SPACE *sp, enum e_spflag spflag
                        if (len >= (ssize_t)sizeof(tmpfname))
                                errx(1, "%s: name too long", fname);
                        unlink(tmpfname);
-                       if ((outfile = fopen(tmpfname, "w")) == NULL)
-                               err(1, "%s", fname);
                        if (outfile != NULL && outfile != stdout)
                                fclose(outfile);
+                       if ((outfile = fopen(tmpfname, "w")) == NULL)
+                               err(1, "%s", fname);
                        fchown(fileno(outfile), sb.st_uid, sb.st_gid);
                        fchmod(fileno(outfile), sb.st_mode & ALLPERMS);
                        outfname = tmpfname;
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to