* Display the appropriate prompt. */
| 750 | * Display the appropriate prompt. |
| 751 | */ |
| 752 | static void |
| 753 | prompt(VOID_PARAM) |
| 754 | { |
| 755 | constant char *p; |
| 756 | |
| 757 | if (ungot != NULL && ungot->ug_char != CHAR_END_COMMAND) |
| 758 | { |
| 759 | /* |
| 760 | * No prompt necessary if commands are from |
| 761 | * ungotten chars rather than from the user. |
| 762 | */ |
| 763 | return; |
| 764 | } |
| 765 | |
| 766 | /* |
| 767 | * Make sure the screen is displayed. |
| 768 | */ |
| 769 | make_display(); |
| 770 | bottompos = position(BOTTOM_PLUS_ONE); |
| 771 | |
| 772 | /* |
| 773 | * If we've hit EOF on the last file and the -E flag is set, quit. |
| 774 | */ |
| 775 | if (get_quit_at_eof() == OPT_ONPLUS && |
| 776 | eof_displayed() && !(ch_getflags() & CH_HELPFILE) && |
| 777 | next_ifile(curr_ifile) == NULL_IFILE) |
| 778 | quit(QUIT_OK); |
| 779 | |
| 780 | /* |
| 781 | * If the entire file is displayed and the -F flag is set, quit. |
| 782 | */ |
| 783 | if (quit_if_one_screen && |
| 784 | entire_file_displayed() && !(ch_getflags() & CH_HELPFILE) && |
| 785 | next_ifile(curr_ifile) == NULL_IFILE) |
| 786 | quit(QUIT_OK); |
| 787 | |
| 788 | #if MSDOS_COMPILER==WIN32C |
| 789 | /* |
| 790 | * In Win32, display the file name in the window title. |
| 791 | */ |
| 792 | if (!(ch_getflags() & CH_HELPFILE)) |
| 793 | { |
| 794 | WCHAR w[MAX_PATH+16]; |
| 795 | p = pr_expand("Less?f - %f.", 0); |
| 796 | MultiByteToWideChar(CP_ACP, 0, p, -1, w, sizeof(w)/sizeof(*w)); |
| 797 | SetConsoleTitleW(w); |
| 798 | } |
| 799 | #endif |
| 800 | |
| 801 | /* |
| 802 | * Select the proper prompt and display it. |
| 803 | */ |
| 804 | /* |
| 805 | * If the previous action was a forward movement, |
| 806 | * don't clear the bottom line of the display; |
| 807 | * just print the prompt since the forward movement guarantees |
| 808 | * that we're in the right position to display the prompt. |
| 809 | * Clearing the line could cause a problem: for example, if the last |
no test coverage detected
searching dependent graphs…