Dushistov / sdcv

https://dushistov.github.io/sdcv/
GNU General Public License v2.0
294 stars 42 forks source link

Fix using SDCV_PAGER #14

Closed citrin closed 7 years ago

citrin commented 7 years ago

Stream opened with popen() should be closed with pclose() as documented in popen(3) man.

At least on FreeBSD SDCV_PAGER wasn't usable, because fclose() doesn't wait for child process (pager) and after termination of sdcv less/more also is terminated. Difference probably not between Linux/BSD, but between different implementations of fclose() in glibc and BSD libc or in llvm libc++ and GNU Standard C++ Library. Anyway pclose() should be used here.

citrin commented 7 years ago

Thanks!