From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Revision 103880 broke the Windows build
Date: Sun, 10 Apr 2011 12:53:50 -0700 [thread overview]
Message-ID: <4DA20ACE.4070303@cs.ucla.edu> (raw)
In-Reply-To: <83bp0erkw7.fsf@gnu.org>
On 04/10/2011 12:01 PM, Eli Zaretskii wrote:
> You are reading MSDN for one of the latest versions of the runtime.
> Not everyone has that installed
Ah, OK, thanks. I committed the following, which uses
memchr instead. Other w32 already uses memchr so memchr
should be OK. A quick Google search says MacOS has it
too.
=== modified file 'src/ChangeLog'
--- src/ChangeLog 2011-04-10 19:12:28 +0000
+++ src/ChangeLog 2011-04-10 19:47:49 +0000
@@ -1,5 +1,7 @@
2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
+ * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
+
Fix more problems found by GCC 4.6.0's static checks.
* xdisp.c (vmessage): Use a better test for character truncation.
=== modified file 'src/xdisp.c'
--- src/xdisp.c 2011-04-10 02:27:15 +0000
+++ src/xdisp.c 2011-04-10 19:47:49 +0000
@@ -8417,10 +8417,13 @@
/* Do any truncation at a character boundary. */
if (! (0 <= len && len < bufsize))
- for (len = strnlen (buf, bufsize);
- len && ! CHAR_HEAD_P (buf[len - 1]);
- len--)
- continue;
+ {
+ char *end = memchr (buf, 0, bufsize);
+ for (len = end ? end - buf : bufsize;
+ len && ! CHAR_HEAD_P (buf[len - 1]);
+ len--)
+ continue;
+ }
message2 (FRAME_MESSAGE_BUF (f), len, 0);
}
next prev parent reply other threads:[~2011-04-10 19:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-10 18:17 Revision 103880 broke the Windows build Eli Zaretskii
2011-04-10 18:29 ` Paul Eggert
2011-04-10 18:48 ` Sudish Joseph
2011-04-10 18:52 ` chad
2011-04-10 19:01 ` Eli Zaretskii
2011-04-10 19:53 ` Paul Eggert [this message]
2011-04-10 20:48 ` Eli Zaretskii
2011-04-10 19:53 ` Andy Moreton
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DA20ACE.4070303@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).