OSDN Git Service

MPW用に、util.c の方の 13 も '\r' に書き直し。
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 2 Feb 2002 04:42:19 +0000 (04:42 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 2 Feb 2002 04:42:19 +0000 (04:42 +0000)
src/main-mac.c
src/util.c

index 2fb6cdd..d564358 100644 (file)
@@ -4474,6 +4474,8 @@ static bool CheckEvents(bool wait)
                                Term_keypress('0' + (ck - 64) % 10);
 
                                /* Hack -- Terminate the sequence */
+                               /* MPW can generate 10 or 13 for keycode of '\r' */
+                               /* -noMapCR option swaps '\r' and '\n' */
                                Term_keypress('\r');
                        }
 
index 351f722..bf1d18a 100644 (file)
@@ -1104,7 +1104,7 @@ static void trigger_text_to_ascii(char **bufptr, cptr *strptr)
                if (str)
                {
                        *s++ = (char)31;
-                       *s++ = (char)13;
+                       *s++ = '\r';
                        *bufptr = s;
                        *strptr = str; /* where **strptr == ']' */
                }
@@ -1136,7 +1136,7 @@ static void trigger_text_to_ascii(char **bufptr, cptr *strptr)
                        break;
                }
        }
-       *s++ = (char)13;
+       *s++ = '\r';
 
        *bufptr = s;
        *strptr = str; /* where **strptr == ']' */
@@ -1308,7 +1308,7 @@ bool trigger_ascii_to_text(char **bufptr, cptr *strptr)
                        }
                        break;
                case '#':
-                       for (j = 0; *str && *str != (char)13; j++)
+                       for (j = 0; *str && *str != '\r'; j++)
                                key_code[j] = *str++;
                        key_code[j] = '\0';
                        break;
@@ -1317,7 +1317,7 @@ bool trigger_ascii_to_text(char **bufptr, cptr *strptr)
                        str++;
                }
        }
-       if (*str++ != (char)13) return FALSE;
+       if (*str++ != '\r') return FALSE;
 
        for (i = 0; i < max_macrotrigger; i++)
        {