From 47955b39aaa36fe123da6fa5e15e40e0061e40ae Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sun, 12 Apr 2009 19:24:10 +0000 Subject: Added \^ and \~ escapes (Joerg). --- ascii.in | 4 +++- mdoc_strings.c | 10 +++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ascii.in b/ascii.in index c9de5cb1..33ed5326 100644 --- a/ascii.in +++ b/ascii.in @@ -1,4 +1,4 @@ -/* $Id: ascii.in,v 1.6 2009/03/27 13:44:24 kristaps Exp $ */ +/* $Id: ascii.in,v 1.7 2009/04/12 19:24:10 kristaps Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * @@ -32,6 +32,8 @@ LINE("`", 1, "`", 1) LINE("%", 1, "%", 1) LINE("-", 1, "-", 1) LINE(" ", 1, " ", 1) +LINE("~", 1, " ", 1) +LINE("^", 1, "", 0) LINE("0", 1, " ", 1) LINE(".", 1, ".", 1) LINE("&", 1, "", 0) diff --git a/mdoc_strings.c b/mdoc_strings.c index b6708f85..64b834ec 100644 --- a/mdoc_strings.c +++ b/mdoc_strings.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_strings.c,v 1.1 2009/03/31 13:50:19 kristaps Exp $ */ +/* $Id: mdoc_strings.c,v 1.2 2009/04/12 19:24:10 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -87,6 +87,10 @@ mdoc_isescape(const char *p) /* FALLTHROUGH */ case ('-'): /* FALLTHROUGH */ + case ('~'): + /* FALLTHROUGH */ + case ('^'): + /* FALLTHROUGH */ case ('%'): /* FALLTHROUGH */ case ('0'): @@ -212,9 +216,9 @@ mdoc_atotime(const char *p) (void)memset(&tm, 0, sizeof(struct tm)); - if (0 == strcmp(p, "$Mdocdate: March 31 2009 $")) + if (0 == strcmp(p, "$Mdocdate: April 12 2009 $")) return(time(NULL)); - if ((pp = strptime(p, "$Mdocdate: March 31 2009 $", &tm)) && 0 == *pp) + if ((pp = strptime(p, "$Mdocdate: April 12 2009 $", &tm)) && 0 == *pp) return(mktime(&tm)); /* XXX - this matches "June 1999", which is wrong. */ if ((pp = strptime(p, "%b %d %Y", &tm)) && 0 == *pp) -- cgit v1.2.3-56-ge451