[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

system() revisited (or: Chimera and external viewers)

I was poking around in the Chimera sources trying to figure out why it
wasn't displaying external documents, and I ran into a problem.  To run
external viewers, Chimera constructs and passes to system() the command

PATH=$PATH:%s; export PATH; %s


PATH=$PATH:%s %s

depending on compile-time configuration; the first %s is replaced with a
path to the viewer applications, and the second by the command to be

The problem is that the MiNTlibs' system() can't handle either of these
command lines.  AFAICT, in the second case it tries to run the
non-existent program 'PATH=$PATH:/usr/bin/X11', and in the first the
even more non-existent program 'PATH=$PATH:/usr/bin/X11;'.

Unfortunately, the Xlib sources aren't available, or I'd just recompile
the thing.  An interim solution would be to invoke sh directly, but I
think this underscores the problem we were discussing last month:
eventually, either system() will have to contain all of sh's command-line
parsing logic, or it will have to invoke /bin/sh.