Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Mar 2020 11:07:48 +0000 (UTC)
From:      Mateusz Piotrowski <0mp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r358954 - head/share/man/man3
Message-ID:  <202003131107.02DB7m60016367@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: 0mp (doc,ports committer)
Date: Fri Mar 13 11:07:48 2020
New Revision: 358954
URL: https://svnweb.freebsd.org/changeset/base/358954

Log:
  CMSG_DATA.3: Fix formatting of printf escape sequences
  
  Escape sequences like "\n" have to be escaped twice in examples in our
  mdoc(7)-based manual pages in order to be displayed properly. The problem
  is that otherwise they are interpreted by mdoc(7), which results in:
  
      printf("parent: received '%s'0, buf);
  
  being shown to the user instead of:
  
      printf("parent: received '%s'\n", buf);
  
  Approved by:	bcr (mentor)
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D24056

Modified:
  head/share/man/man3/CMSG_DATA.3

Modified: head/share/man/man3/CMSG_DATA.3
==============================================================================
--- head/share/man/man3/CMSG_DATA.3	Fri Mar 13 10:29:31 2020	(r358953)
+++ head/share/man/man3/CMSG_DATA.3	Fri Mar 13 11:07:48 2020	(r358954)
@@ -2,7 +2,7 @@
 .\" Public domain, July 3, 2005
 .\"
 .\" $FreeBSD$
-.Dd November 1, 2018
+.Dd March 13, 2020
 .Dt CMSG_DATA 3
 .Os
 .Sh NAME
@@ -142,7 +142,7 @@ main()
 			    cmsg->cmsg_level == SOL_SOCKET &&
 			    cmsg->cmsg_type == SCM_RIGHTS) {
 				hellofd[1] = *(int *)CMSG_DATA(cmsg);
-				printf("child: sending '%s'\n", buf);
+				printf("child: sending '%s'\\n", buf);
 				if (write(hellofd[1], buf, HELLOLEN) == -1)
 				    err(EX_IOERR, "failed to send 'hello'");
 			}
@@ -166,7 +166,7 @@ main()
 
 		if (read(hellofd[0], buf, HELLOLEN) == -1)
 			err(EX_IOERR, "faild to receive 'hello'");
-		printf("parent: received '%s'\n", buf);
+		printf("parent: received '%s'\\n", buf);
 		break;
 	}
 



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