Hello, Thank you for your comments. Please see my comments below.
With regards, > Sent: Friday, November 14, 2014 at 8:48 PM > From: "Philip Guenther" <[email protected]> > To: "Kamil Rytarowski" <[email protected]> > Cc: tech-openbsd <[email protected]> > Subject: Re: mg(1) comaptibility patches > > On Fri, Nov 14, 2014 at 11:29 AM, Kamil Rytarowski <[email protected]> wrote: > > As maintaining local patches or forking mg(1) for plain compatibility > > is doubtful, I'm going to send you a set of patches. > > > > I don't want to make noise with a mail per patch, so I'm attaching all > > patches to this mail. > > Please review (if needed adapt) and merge. > > > > List of files: > ... > > 0002-Add-missing-include-for-struct-timespec-NetBSD.patch > > sysdef.h should include <time.h> for struct timespec; <sys/time.h> is > not required to provide it. Fixed. I changed it to be pulled on all platforms. > > ... > > 0006-Enhance-type-correctness-cast-parameter-of-isspace-3.patch > > This diff is wrong, sorry. The code where a ctype function is being > called on a char from a char * pointer should be casting to (unsigned > char); the code where 'c' is set from lgetc() should declare c as an > int, as lgetc() does the necessary cast. > Hopefully fixed. > > Philip Guenther >
>From 4a1225c6c64fc857c6442b0135642a109f1d045d Mon Sep 17 00:00:00 2001 From: Kamil Rytarowski <[email protected]> Date: Fri, 14 Nov 2014 17:55:36 +0000 Subject: [PATCH 2/6] Add missing include for struct timespec --- sysdef.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sysdef.h b/sysdef.h index 3fde496..2f5078e 100644 --- a/sysdef.h +++ b/sysdef.h @@ -29,6 +29,7 @@ #include <string.h> #include <errno.h> #include <signal.h> +#include <time.h> #define KBLOCK 8192 /* Kill grow. */ #define GOOD 0 /* Good exit status. */ -- 2.1.0
>From 4df46840b96e4de796e822f6636ea0e59b55697a Mon Sep 17 00:00:00 2001 From: Kamil Rytarowski <[email protected]> Date: Fri, 14 Nov 2014 18:34:44 +0000 Subject: [PATCH 6/6] Enhance parameter type correctness of ctype functions --- cscope.c | 2 +- extend.c | 2 +- grep.c | 3 ++- tags.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cscope.c b/cscope.c index 0deada3..b334e6b 100644 --- a/cscope.c +++ b/cscope.c @@ -557,7 +557,7 @@ prettyprint(struct buffer *bp, struct cstokens *t) const char * ltrim(const char *s) { - while (isblank(*s)) + while (isblank((unsigned char)*s)) s++; return s; } diff --git a/extend.c b/extend.c index ef59d5f..6196691 100644 --- a/extend.c +++ b/extend.c @@ -446,7 +446,7 @@ dobindkey(KEYMAP *map, const char *func, const char *str) for (i = 0; *str && i < MAXKEY; i++) { /* XXX - convert numbers w/ strol()? */ if (*str == '^' && *(str + 1) != '\0') { - key.k_chars[i] = CCHR(toupper(*++str)); + key.k_chars[i] = CCHR(toupper((unsigned char)*++str)); } else if (*str == '\\' && *(str + 1) != '\0') { switch (*++str) { case '^': diff --git a/grep.c b/grep.c index 6a4c1c4..55f7ae1 100644 --- a/grep.c +++ b/grep.c @@ -113,7 +113,8 @@ static int gid(int f, int n) { char command[NFILEN]; - char cprompt[NFILEN], c, *bufp; + char cprompt[NFILEN], *bufp; + int c; struct buffer *bp; struct mgwin *wp; int i, j, len; diff --git a/tags.c b/tags.c index e847b9e..b75f703 100644 --- a/tags.c +++ b/tags.c @@ -482,7 +482,7 @@ curtoken(int f, int n, char *token) /* strip away leading whitespace if any like emacs. */ while (ltext(curwp->w_dotp) && - isspace(curwp->w_dotp->l_text[tdoto])) + isspace((unsigned char)curwp->w_dotp->l_text[tdoto])) tdoto++; size = curwp->w_doto - tdoto; -- 2.1.0
