=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/less/ch.c,v retrieving revision 1.22 retrieving revision 1.23 diff -c -r1.22 -r1.23 *** src/usr.bin/less/ch.c 2021/08/07 12:41:51 1.22 --- src/usr.bin/less/ch.c 2024/04/14 18:11:54 1.23 *************** *** 778,784 **** if (thisfile == NULL) return; ! if (ch_flags & (CH_CANSEEK|CH_POPENED|CH_HELPFILE)) { /* * We can seek or re-open, so we don't need to keep buffers. */ --- 778,784 ---- if (thisfile == NULL) return; ! if (ch_flags & (CH_CANSEEK|CH_HELPFILE)) { /* * We can seek or re-open, so we don't need to keep buffers. */ *************** *** 790,800 **** /* * We don't need to keep the file descriptor open * (because we can re-open it.) - * But don't really close it if it was opened via popen(), - * because pclose() wants to close it. */ ! if (!(ch_flags & CH_POPENED)) ! close(ch_file); ch_file = -1; } else { keepstate = TRUE; --- 790,797 ---- /* * We don't need to keep the file descriptor open * (because we can re-open it.) */ ! close(ch_file); ch_file = -1; } else { keepstate = TRUE;