OSDN Git Service

文字列入力時に文字列の最後で^Dなどでの削除を使うと, 文字列終端のすぐ
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 21 Oct 2003 14:27:29 +0000 (14:27 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 21 Oct 2003 14:27:29 +0000 (14:27 +0000)
右のゴミを文字列終端にコピーしていたバグを修正.

src/autopick.c
src/util.c

index 4271fb8..959abb7 100644 (file)
@@ -3169,7 +3169,7 @@ static byte get_string_for_search(object_type **o_handle, cptr *search_strp)
                        /* Now on insert mode */
                        color = TERM_WHITE;
 
-                       /* No move at biggining of line */
+                       /* No move at beginning of line */
                        if (0 == pos) break;
 
                        while (TRUE)
@@ -3246,7 +3246,7 @@ static byte get_string_for_search(object_type **o_handle, cptr *search_strp)
                        /* Now on insert mode */
                        color = TERM_WHITE;
 
-                       /* No move at biggining of line */
+                       /* No move at beginning of line */
                        if (0 == pos) break;
 
                        while (TRUE)
@@ -3279,6 +3279,9 @@ static byte get_string_for_search(object_type **o_handle, cptr *search_strp)
                        /* Now on insert mode */
                        color = TERM_WHITE;
 
+                       /* No move at end of line */
+                       if ('\0' == buf[pos]) break;
+
                        /* Position of next character */
                        src = pos + 1;
 
index ae58ec4..d897b44 100644 (file)
@@ -3207,7 +3207,7 @@ bool askfor_aux(char *buf, int len)
                        /* Now on insert mode */
                        color = TERM_WHITE;
 
-                       /* No move at biggining of line */
+                       /* No move at beginning of line */
                        if (0 == pos) break;
 
                        while (TRUE)
@@ -3267,7 +3267,7 @@ bool askfor_aux(char *buf, int len)
                        /* Now on insert mode */
                        color = TERM_WHITE;
 
-                       /* No move at biggining of line */
+                       /* No move at beginning of line */
                        if (0 == pos) break;
 
                        while (TRUE)
@@ -3300,6 +3300,9 @@ bool askfor_aux(char *buf, int len)
                        /* Now on insert mode */
                        color = TERM_WHITE;
 
+                       /* No move at end of line */
+                       if ('\0' == buf[pos]) break;
+
                        /* Position of next character */
                        src = pos + 1;