#include "support/docstring.h"
#include "support/lstrings.h"
#include "support/os.h"
+#include "support/debug.h"
#include <algorithm> // for remove
#include <cstdlib>
// CHECK Look at and fix this.
// f.ex. what about error checking?
- string const encoded = to_local8bit(from_utf8(value));
+ string encoded;
+ try {
+ encoded = to_local8bit(from_utf8(value));
+ } catch (...) {
+ return false;
+ }
+
#if defined (HAVE_SETENV)
return ::setenv(name.c_str(), encoded.c_str(), 1) == 0;
#elif defined (HAVE_PUTENV)
// Prepend each new element to the list, removing identical elements
// that occur later in the list.
+ LYXERR(Debug::INIT, "Prepending \"" << prefix << "\" to PATH");
typedef vector<string>::const_reverse_iterator token_iterator;
token_iterator it = reversed_tokens.rbegin();
token_iterator const end = reversed_tokens.rend();