Fix scanning of characters in ptex
patch by Hironori Kitagawa
upstream svn 27076

reported in http://oku.edu.mie-u.ac.jp/tex/mod/forum/
QA -> Forums -> 一般フォーラム ->  Improper alphabetic constant.　がでない？

Test case: the following tex file:
\newcount\foo
\foo`\A
\showthe\foo % 65
\foo`\AA % !?
\showthe\foo
\bye

when run through etex gives the correct:
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2012/dev/W32TeX)
 restricted \write18 enabled.
entering extended mode
(./test.tex
> 65.
l.3 \showthe\foo
                 % 65
?
! Improper alphabetic constant.

                   \AA
l.4 \foo`\AA
             % !?
?
> 48.
l.5 \showthe\foo

?
[1] )
Output written on test.dvi (1 page, 220 bytes).
Transcript written on test.log.



while when running through eptex it gives the wrong:
This is e-pTeX, Version 3.1415926-p3.2-110825-2.3 (sjis) (TeX Live
2012/dev/W32TeX)
 restricted \write18 enabled.
entering extended mode
(./test.tex
> 65.
l.3 \showthe\foo
                 % 65
?
> 452.
l.5 \showthe\foo

?
 )
No pages of output.
Transcript written on test.log.


--

Index: texlive-bin-2012.20120628/texk/web2c/ptexdir/ChangeLog
===================================================================
--- texlive-bin-2012.20120628.orig/texk/web2c/ptexdir/ChangeLog	2012-05-23 16:16:33.000000000 +0900
+++ texlive-bin-2012.20120628/texk/web2c/ptexdir/ChangeLog	2012-07-18 02:20:01.638046297 +0900
@@ -1,3 +1,8 @@
+2012-07-17  Hironori Kitagawa  <h_kitagawa2001@yahoo.co.jp>
+
+	* ptex-base.ch: fix a bug in
+	@<Scan an alphabetic character code into |cur_val|@>
+
 2012-05-22  Peter Breitenlohner  <peb@mppmu.mpg.de>
 
 	* pdvitype.test, sample.test: Cope with spaces in paths returned
Index: texlive-bin-2012.20120628/texk/web2c/ptexdir/ptex-base.ch
===================================================================
--- texlive-bin-2012.20120628.orig/texk/web2c/ptexdir/ptex-base.ch	2012-05-12 21:40:41.000000000 +0900
+++ texlive-bin-2012.20120628/texk/web2c/ptexdir/ptex-base.ch	2012-07-18 02:19:29.125987453 +0900
@@ -2149,7 +2149,7 @@
 else if cur_tok<cs_token_flag+single_base then
   cur_val:=cur_tok-cs_token_flag-active_base
 else cur_val:=cur_tok-cs_token_flag-single_base;
-if (cur_val>255)and(cur_cmd<kanji) then
+if (cur_val>255)and((cur_cmd<kanji)or(cur_cmd>max_char_code)) then
   begin print_err("Improper alphabetic or KANJI constant");
 @.Improper alphabetic constant@>
   help2("A one-character control sequence belongs after a ` mark.")@/
