Fix a fun bug where, every now again, ego would get its temporary files mangled
authorDavid Given <dg@cowlark.com>
Mon, 22 Aug 2016 21:53:01 +0000 (23:53 +0200)
committerDavid Given <dg@cowlark.com>
Mon, 22 Aug 2016 21:53:01 +0000 (23:53 +0200)
commit2b6d251dec7854902adfaf45e461bb29ce753312
treeca461514d95526044eb4c2cac61df6771ef3517a
parent2a95b1c5e390a40bd838584a6ee87dc26440d958
Fix a fun bug where, every now again, ego would get its temporary files mangled
and generate invalid calls to the optimisers.

Previously ego would generate a temporary file template that looked like
/tmp/ego.A.BB.XXXXXX, call mktemp() on it to randomise the XXXXXX, and then
replace A and BB with data.

However, it used strrchr to find the A and B. Which would fine, except when
mktemp produced an A or a B in the randomised part...

This code was written on 4 March 1991. I was 16.
util/ego/em_ego/em_ego.c