Commit 03ccf59c authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

Fix run-time computation of automata path.

* taf-kit/src/library_commands.hh (get_automata_path): Search for
vcsn- in program_name, do not assume it is at the beginning.  This
was causing trouble when Taf-Kit was run as './vcsn-char-b' for
instance, because it would then remove the first five characters
and look for a directory named '/n-char-b'.
parent 1707fd0a
2009-09-04 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Fix run-time computation of automata path.
* taf-kit/src/library_commands.hh (get_automata_path): Search for
vcsn- in program_name, do not assume it is at the beginning. This
was causing trouble when Taf-Kit was run as './vcsn-char-b' for
instance, because it would then remove the first five characters
and look for a directory named '/n-char-b'.
2009-09-04 Alexandre Duret-Lutz <adl@lrde.epita.fr>
 
Fix configure-time computation of VCSN_DATA_PATH.
......
......@@ -2,7 +2,7 @@
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2006, 2008 The Vaucanson Group.
// Copyright (C) 2006, 2008, 2009 The Vaucanson Group.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
......@@ -67,8 +67,10 @@ get_automata_path(const arguments_t& args)
base_path = VCSN_DATA_PATH;
// Strip "vcsn-" from the program name.
const std::string lib_dir =
std::string("/automata/") + (program_name + 5);
const char* suffix = strrchr(program_name, '/');
suffix = suffix ? suffix + 6 : program_name + 5;
const std::string lib_dir = std::string("/automata/") + suffix;
std::string path;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment