| 979 | /* Returns specified line from message history, or NULL if out of bounds */ |
| 980 | |
| 981 | static nhprev_mesg * |
| 982 | get_msg_line(boolean reverse, int mindex) |
| 983 | { |
| 984 | int count; |
| 985 | nhprev_mesg *current_mesg; |
| 986 | |
| 987 | if (reverse) { |
| 988 | current_mesg = last_mesg; |
| 989 | for (count = 0; count < mindex; count++) { |
| 990 | if (!current_mesg) |
| 991 | break; |
| 992 | current_mesg = current_mesg->prev_mesg; |
| 993 | } |
| 994 | } else { |
| 995 | current_mesg = first_mesg; |
| 996 | for (count = 0; count < mindex; count++) { |
| 997 | if (!current_mesg) |
| 998 | break; |
| 999 | current_mesg = current_mesg->next_mesg; |
| 1000 | } |
| 1001 | } |
| 1002 | return current_mesg; |
| 1003 | } |
| 1004 | |
| 1005 | /* save/restore code retrieves one ^P message at a time during save and |
| 1006 | puts it into save file; if any new messages are added to the list while |
no outgoing calls
no test coverage detected