Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jan 2015 19:46:20 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r277811 - head/usr.bin/sed
Message-ID:  <201501271946.t0RJkKlC020483@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501271946.t0RJkKlC020483>