aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2013-08-20 17:03:30 +0200
committerJoakim Verona2013-08-20 17:03:30 +0200
commitb657a571a916b158914f2a1e8bd8a5f1e7fa2872 (patch)
tree380f24bf59176fba8b033ad7d2d3df526d1ee339
parentdd9b511aa5fc7194cec86398548f9e2afa0e435e (diff)
parent3f246b657225c786c460b22d774ab0b2e7488b55 (diff)
downloademacs-b657a571a916b158914f2a1e8bd8a5f1e7fa2872.tar.gz
emacs-b657a571a916b158914f2a1e8bd8a5f1e7fa2872.zip
merge from trunk
-rw-r--r--doc/lispref/ChangeLog5
-rw-r--r--doc/lispref/files.texi8
-rw-r--r--src/ChangeLog4
-rw-r--r--src/character.c14
4 files changed, 29 insertions, 2 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 3f9d23a5476..d2e86c25cc1 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,8 @@
12013-08-20 Eli Zaretskii <eliz@gnu.org>
2
3 * files.texi (Information about Files): Mention file names with
4 trailing blanks on MS-Windows. (Bug#15130)
5
12013-08-18 Xue Fuqiao <xfq.free@gmail.com> 62013-08-18 Xue Fuqiao <xfq.free@gmail.com>
2 7
3 * positions.texi (Positions): Improve indexing. 8 * positions.texi (Positions): Improve indexing.
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 77b097ae90a..1f7169522cc 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -776,6 +776,14 @@ return information about actual files or directories, so their
776arguments must all exist as actual files or directories unless 776arguments must all exist as actual files or directories unless
777otherwise noted. 777otherwise noted.
778 778
779@cindex file names, trailing whitespace
780@cindex trailing blanks in file names
781Be careful with file names that end in blanks: some filesystems
782(notably, MS-Windows) will ignore trailing whitespace in file names,
783and return information about the file after stripping those blanks
784from the name, not about the file whose name you passed to the
785functions described in this section.
786
779@menu 787@menu
780* Testing Accessibility:: Is a given file readable? Writable? 788* Testing Accessibility:: Is a given file readable? Writable?
781* Kinds of Files:: Is it a directory? A symbolic link? 789* Kinds of Files:: Is it a directory? A symbolic link?
diff --git a/src/ChangeLog b/src/ChangeLog
index e21d82bdc09..997459f01c2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12013-08-20 Kenichi Handa <handa@gnu.org>
2
3 * character.c (string_char): Improve commentary.
4
12013-08-20 Paul Eggert <eggert@cs.ucla.edu> 52013-08-20 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 * image.c (SIGNATURE_DIGESTSIZE): Remove. 7 * image.c (SIGNATURE_DIGESTSIZE): Remove.
diff --git a/src/character.c b/src/character.c
index b2caaa290af..1bde2364e37 100644
--- a/src/character.c
+++ b/src/character.c
@@ -174,11 +174,14 @@ string_char (const unsigned char *p, const unsigned char **advanced, int *len)
174 174
175 if (*p < 0x80 || ! (*p & 0x20) || ! (*p & 0x10)) 175 if (*p < 0x80 || ! (*p & 0x20) || ! (*p & 0x10))
176 { 176 {
177 /* 1-, 2-, and 3-byte sequences can be handled by the macro. */
177 c = STRING_CHAR_ADVANCE (p); 178 c = STRING_CHAR_ADVANCE (p);
178 } 179 }
179 else if (! (*p & 0x08)) 180 else if (! (*p & 0x08))
180 { 181 {
181 c = ((((p)[0] & 0xF) << 18) 182 /* A 4-byte sequence of this form:
183 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */
184 c = ((((p)[0] & 0x7) << 18)
182 | (((p)[1] & 0x3F) << 12) 185 | (((p)[1] & 0x3F) << 12)
183 | (((p)[2] & 0x3F) << 6) 186 | (((p)[2] & 0x3F) << 6)
184 | ((p)[3] & 0x3F)); 187 | ((p)[3] & 0x3F));
@@ -186,7 +189,14 @@ string_char (const unsigned char *p, const unsigned char **advanced, int *len)
186 } 189 }
187 else 190 else
188 { 191 {
189 c = ((((p)[1] & 0x3F) << 18) 192 /* A 5-byte sequence of this form:
193
194 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
195
196 Note that the top 4 `x's are always 0, so shifting p[1] can
197 never exceed the maximum valid character codepoint. */
198 c = (/* (((p)[0] & 0x3) << 24) ... always 0, so no need to shift. */
199 (((p)[1] & 0x3F) << 18)
190 | (((p)[2] & 0x3F) << 12) 200 | (((p)[2] & 0x3F) << 12)
191 | (((p)[3] & 0x3F) << 6) 201 | (((p)[3] & 0x3F) << 6)
192 | ((p)[4] & 0x3F)); 202 | ((p)[4] & 0x3F));