[This is discussion so I am moving it to -beta. Note to Olivier the
previous version had a typo in the address]
Olivier Galibert <galibert(a)pobox.com> writes:
to have make-dump-id.c work on windows (it uses gettimeofday to get
a
very-pseudo random number. Any other strategy is welcome).
UUID's are probably too long?
For instance, if the executable is called as ./xemacs-21.2-b29 and
the
id is 38b6cf7e, the tests are in this order:
./xemacs-21.2-b29-21.2-b29-38b6cf7e.dmp
./xemacs-21.2-b29-38b6cf7e.dmp
./xemacs-21.2-b29.dmp
./xemacs-21.2-21.2-b29-38b6cf7e.dmp
./xemacs-21.2-38b6cf7e.dmp
./xemacs-21.2.dmp
./xemacs-21-21.2-b29-38b6cf7e.dmp
/xemacs-21-38b6cf7e.dmp
./xemacs-21.dmp
./xemacs-21.2-b29-38b6cf7e.dmp
./xemacs-38b6cf7e.dmp
./xemacs.dmp
I guess the default is normally such that it finds it in one go?
MISSING FEATURE ALERT!
However you missed a critical feature of the current location code
(one that is so nice I even implemented it for LyX). Consider the
common
configure --prefix=/opt/gnu/ba/bla/bla/bla/xemacs
make install
ln -s /opt/gnu/ba/bla/bla/bla/xemacs/bin/xemacs /usr/local/bin/xemacs
Therefore your code needs to match the current one which goes like
this
char * dump_file=NULL;
char * inv_path;
invpath = compute_invocation_name();
do
{
/* d_f_b_o_a returns NULL on failure */
dump_file = dump_file_by_oliviers_algorithm(inv_path);
if (!dump_file && is_symlink(inv_path))
inv_path = symlink_value(invpath);
else
inv_path = NULL
} while (!invpath);
if (!dump_file)
scream;
Note that just calling realpath is not sufficient.
Jan