[docbook-utils] fix escaping of double-quotes in docbook2man (#826139), fix the wrong format of C-style functions in

Ondrej Vasik ovasik at fedoraproject.org
Wed May 30 12:19:12 UTC 2012


commit 7371bfd6e53932997f7cd00e054b747c6a6dc44f
Author: Ondřej Vašík <ovasik at redhat.com>
Date:   Wed May 30 14:19:07 2012 +0200

    fix escaping of double-quotes in docbook2man (#826139), fix the wrong format of C-style functions in docbook2man (#662869), fix stray .fi at the end of funcsynopsis section (#662869)

 docbook-utils.spec  |    7 ++++++-
 docbook2man-spec.pl |   23 ++++++++++++++++++-----
 2 files changed, 24 insertions(+), 6 deletions(-)
---
diff --git a/docbook-utils.spec b/docbook-utils.spec
index f66d32f..4811ef5 100644
--- a/docbook-utils.spec
+++ b/docbook-utils.spec
@@ -1,6 +1,6 @@
 Name: docbook-utils
 Version: 0.6.14
-Release: 30%{?dist}
+Release: 31%{?dist}
 Group: Applications/Text
 
 Summary: Shell scripts for managing DocBook documents
@@ -138,6 +138,11 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/*/docbook2ps.*
 
 %changelog
+* Wed May 30 2012 Ondrej Vasik <ovasik at redhat.com> 0.6.14-31
+- fix escaping of double-quotes in docbook2man (#826139)
+- fix the wrong format of C-style functions in docbook2man (#662869)
+- fix stray .fi at the end of funcsynopsis section (#662869)
+
 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.6.14-30
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 
diff --git a/docbook2man-spec.pl b/docbook2man-spec.pl
old mode 100644
new mode 100755
index 6717a06..58939cb
--- a/docbook2man-spec.pl
+++ b/docbook2man-spec.pl
@@ -193,7 +193,7 @@ sub fold_string
 	$_ = shift;
 	
 	s/\\/\\\\/g;
-	s/"/\\\&"/g;
+	s/"/""/g;
 
 	# Change tabs and newlines to spaces
 	# The newlines will be swallowed later while trimming
@@ -483,8 +483,8 @@ man_sgml('<FUNCSYNOPSIS>', sub {
 	bold_on();
 });
 man_sgml('</FUNCSYNOPSIS>', sub {
+	man_output("\n.fi");
 	font_off();
-	man_output "\n.fi";
 });
 
 man_sgml('<CMDSYNOPSIS>', "\n.sp\n");
@@ -493,9 +493,22 @@ man_sgml('</CMDSYNOPSIS>', "\n");
 man_sgml('<FUNCPROTOTYPE>', "\n.sp\n");
 
 # Arguments to functions.  This is C convention.
-man_sgml('<PARAMDEF>', '(');
-man_sgml('</PARAMDEF>', ");\n");
-man_sgml('<VOID>', "(void);\n");
+#man_sgml('<PARAMDEF>', '(');
+#man_sgml('</PARAMDEF>', ");\n");
+#man_sgml('<VOID>', "(void);\n");
+sub paramdef
+{
+	if($_[0]->parent->ext->{'inparams'}) {
+		output ', ';
+	} else {
+		output ' (';
+		$_[0]->parent->ext->{'inparams'} = 1;
+	}
+}
+man_sgml('<PARAMDEF>', \&paramdef);
+man_sgml('</FUNCPROTOTYPE>', ");\n");
+man_sgml('<VOID>', "(void");
+man_sgml('<VARARGS>', "(...");
 
 
 sub arg_start


More information about the scm-commits mailing list