Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#2 popen binary mode (fix image conversion)

closed
nobody
None
5
2009-03-29
2005-04-10
Thorsten Maerz
No

On win32, data from popen() calls gets truncated cause the
pipe is not in binary mode. Using "rb" instead of "r" as
mode fixes this and shouldn't cause problems on posix
systems.

E.g. invoking the original dos exe:
gocr_dos -i lotr-1-4-00001.bmp
will fail with
ERROR src\pnm.c L289: read

Attached patch works with the released tarball (0.40) as
well as with the CVS sources (applies with small offset).

I checked the patch with MinGW-gcc 2.95 and 3.3.1 and it
works OK (btw., the autoconf way works already nicely
using MSys, even "make frontend" creates a fully working
executable).

Discussion

  • Thorsten Maerz
    Thorsten Maerz
    2005-04-10

    popen-binary.patch

     
    Attachments
  • Logged In: YES
    user_id=42379

    popen(...,"rb") does not work on my SuSE-9.3 system. Popen
    fails always. Man pages does not mention "b" tolerance like
    fopen manpages do.
    I cannot accept that patch therefore.

    Joerg

     
  • will try a workarround on 0.47, not tested on Win

     
    • status: open --> closed