From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Add back in a check that the leading `-' exists for arguments.
Date: Sat, 18 Jun 2011 12:53:27 -0400 (EDT) [thread overview]
Message-ID: <201106181653.p5IGrR9x029740@krisdoz.my.domain> (raw)
Log Message:
-----------
Add back in a check that the leading `-' exists for arguments. This
mysteriously disappeared in 1.14. No idea why. While here, remove an
unnecessary header and order the function prototypes.
Modified Files:
--------------
mdocml:
mdoc_argv.c
Revision Data
-------------
Index: mdoc_argv.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_argv.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -Lmdoc_argv.c -Lmdoc_argv.c -u -p -r1.79 -r1.80
--- mdoc_argv.c
+++ mdoc_argv.c
@@ -21,7 +21,6 @@
#include <sys/types.h>
#include <assert.h>
-#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -52,16 +51,16 @@ struct mdocarg {
const enum mdocargt *argvs;
};
+static void argn_free(struct mdoc_arg *, int);
static enum margserr args(struct mdoc *, int, int *,
char *, enum argsflag, char **);
static int args_checkpunct(const char *, int);
-static int argv_single(struct mdoc *, int,
+static int argv_multi(struct mdoc *, int,
struct mdoc_argv *, int *, char *);
static int argv_opt_single(struct mdoc *, int,
struct mdoc_argv *, int *, char *);
-static int argv_multi(struct mdoc *, int,
+static int argv_single(struct mdoc *, int,
struct mdoc_argv *, int *, char *);
-static void argn_free(struct mdoc_arg *, int);
static const enum argvflag argvflags[MDOC_ARG_MAX] = {
ARGV_NONE, /* MDOC_Split */
@@ -290,8 +289,8 @@ mdoc_argv(struct mdoc *m, int line, enum
return(ARGV_EOLN);
else if (NULL == (ap = mdocargs[tok].argvs))
return(ARGV_WORD);
-
- assert(' ' != buf[*pos]);
+ else if ('-' != buf[*pos])
+ return(ARGV_WORD);
/* Seek to the first unescaped space. */
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
reply other threads:[~2011-06-18 16:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201106181653.p5IGrR9x029740@krisdoz.my.domain \
--to=kristaps@mdocml.bsd.lv \
--cc=source@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).