Unknown reporter writes

Indexing a postscript file with apostrophes in its name is not possible. From the log messages I infer that ../utils/execmd.cpp calls pstotext, which in turn calls sh, which tries to executes gs on the file. The shell command fails because the filename is enclosed in apostrophes. It’s a bug of pstotext as the following test shows:

$ pstotext "tes’t.ps" sh: -c: line 0: unexpected EOF while looking for matching ‘'’ sh: -c: line 1: syntax error: unexpected end of file

As a workaround apostrophes in the filename could be replaced by "\'". The following works:

$ pstotext "tes'\''t.ps"

medoc writes

Sorry, can’t reproduce the problem.

 I think that we're not using the same pstotext. I am using the one from:
http://pages.cs.wisc.edu/~ghost/doc/pstotext.htm, as recommended in the recoll documentation.

This is a C program using execvp to start gs, and it seems to be immune to special character issues (as expected). rclps seems to handle them correctly too.

Where does your pstotext come from ? I’d like to include a warning in the documentation. Not that single quotes in file names are that common though … :)

Unknown User writes

I’m using pstotext from http://mirror.cs.wisc.edu/pub/mirrors/ghost/contrib/pstotext-1.9.tar.gz, which uses the code "system(gs_cmdline)" to call gs.

medoc writes

My apologies, you’re right, I was looking at the work directory for the FreeBSD port. The FreeBSD port patches the source to use execvp() instead of system(), I should have looked at pristine pstotext code instead of being lazy and letting the port do the untar for me…

Actually, it seems that the patch originated on debian, see: http://packages.debian.org/squeeze/pstotext and http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=356988

I am storing a version of the patch stripped of the debian/ directory on recoll.org for convenience, this is the equivalent of the FreeBSD port patch (minus some freebsdism’s) and can be applied to the pstotext-1.9 source to get the fixed version: http://www.recoll.org/files/pstotext-1.9_4-debian.patch

Thanks for reporting this.