Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Nov 2002 04:07:55 +0900 (JST)
From:      Hiroki Sato <hrs@eos.ocn.ne.jp>
To:        freebsd-doc@FreeBSD.ORG
Subject:   ifhp script in handbook/printing/chapter.sgml
Message-ID:  <20021116.040755.55801713.hrs@eos.ocn.ne.jp>

index | next in thread | raw e-mail

[-- Attachment #1 --]
Hi,

 handbook/printing/chapter.sgml suggests a filter script `ifhp' to
 examine if the printing data is in PostScript or not, but when
 the data is a plain text, spaces in the first line are chopped
 by the script.  `read' chops spaces at the head of the line,
 and `echo' converts continuous spaces into a single one.
 I think this is an undesirable behavior.

 Could anyone review the attached patch contributed by
 Kimura-san(one of doc-jp translators) to fix the problem?
 I will commit this if no one complains in a couple of days.

-- 
| Hiroki SATO  <hrs@eos.ocn.ne.jp>

[-- Attachment #2 --]
Index: en_US.ISO8859-1/books/handbook/printing/chapter.sgml
===================================================================
RCS file: /home/ncvs/doc/en_US.ISO8859-1/books/handbook/printing/chapter.sgml,v
retrieving revision 1.60
diff -d -u -I\$FreeBSD:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.60 chapter.sgml
--- en_US.ISO8859-1/books/handbook/printing/chapter.sgml	30 Sep 2002 15:39:34 -0000	1.60
+++ en_US.ISO8859-1/books/handbook/printing/chapter.sgml	15 Nov 2002 18:01:14 -0000
@@ -1831,7 +1831,7 @@
 #  Installed in /usr/local/libexec/psif
 #
 
-read first_line
+IFS="" read -r first_line
 first_two_chars=`expr "$first_line" : '\(..\)'`
 
 if [ "$first_two_chars" = "%!" ]; then
@@ -1905,7 +1905,7 @@
 #
 #  Read first two characters of the file
 #
-read first_line
+IFS="" read -r first_line
 first_two_chars=`expr "$first_line" : '\(..\)'`
 
 if [ "$first_two_chars" = "%!" ]; then
@@ -1932,7 +1932,7 @@
     #  Plain text or HP/PCL, so just print it directly; print a form feed
     #  at the end to eject the last page.
     #
-    echo $first_line &amp;&amp; cat &amp;&amp; printf "\033&amp;l0H" &amp;&amp; 
+    echo "$first_line" &amp;&amp; cat &amp;&amp; printf "\033&amp;l0H" &amp;&amp; 
 exit 0
 fi
 
help

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