aboutsummaryrefslogtreecommitdiff
path: root/ovsdb
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-03-09 14:50:39 -0800
committerBen Pfaff <blp@nicira.com>2012-03-19 10:25:22 -0700
commit5955764c2794cab79d97705f7a67beefd8a61d02 (patch)
tree79a261632b5e4e1e8af74f4fcef99c3e67fd401f /ovsdb
parentc233d1b2ba095afe88fc3b763dabfec9dfbfcf0d (diff)
ovsdb-doc: Convert '-' preceding a number as a minus sign, not a hyphen.
ovs-vswitchd.conf.db.5 contains the following sentence: If the interface cannot be added then Open vSwitch sets this column to -1. The '-' in "-1" should be a minus sign, not a hyphen, but the heuristic in ovsdb-doc wasn't smart enough. This commit improves the heuristic and fixes the problem. Found by lintian. Reported-by: Thomas Goirand <zigo@debian.org> Reviewed-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'ovsdb')
-rwxr-xr-xovsdb/ovsdb-doc.in8
1 files changed, 4 insertions, 4 deletions
diff --git a/ovsdb/ovsdb-doc.in b/ovsdb/ovsdb-doc.in
index 8e0e1718..7d257c15 100755
--- a/ovsdb/ovsdb-doc.in
+++ b/ovsdb/ovsdb-doc.in
@@ -16,9 +16,9 @@ argv0 = sys.argv[0]
def textToNroff(s, font=r'\fR'):
def escape(match):
c = match.group(0)
- if c == '-':
- if font == r'\fB':
- return r'\-'
+ if c.startswith('-'):
+ if c != '-' or font == r'\fB':
+ return '\\' + c
else:
return '-'
if c == '\\':
@@ -31,7 +31,7 @@ def textToNroff(s, font=r'\fR'):
raise error.Error("bad escape")
# Escape - \ " ' as needed by nroff.
- s = re.sub('([-"\'\\\\])', escape, s)
+ s = re.sub('(-[0-9]|[-"\'\\\\])', escape, s)
if s.startswith('.'):
s = '\\' + s
return s