* ClosePager * * Close previously opened pager pipe, if any */
| 3024 | * Close previously opened pager pipe, if any |
| 3025 | */ |
| 3026 | void |
| 3027 | ClosePager(FILE *pagerpipe) |
| 3028 | { |
| 3029 | if (pagerpipe && pagerpipe != stdout) |
| 3030 | { |
| 3031 | /* |
| 3032 | * If printing was canceled midstream, warn about it. |
| 3033 | * |
| 3034 | * Some pagers like less use Ctrl-C as part of their command set. Even |
| 3035 | * so, we abort our processing and warn the user what we did. If the |
| 3036 | * pager quit as a result of the SIGINT, this message won't go |
| 3037 | * anywhere ... |
| 3038 | */ |
| 3039 | if (cancel_pressed) |
| 3040 | fprintf(pagerpipe, _("Interrupted\n")); |
| 3041 | |
| 3042 | pclose(pagerpipe); |
| 3043 | restore_sigpipe_trap(); |
| 3044 | } |
| 3045 | } |
| 3046 | |
| 3047 | /* |
| 3048 | * Initialise a table contents struct. |
no test coverage detected