>>>>> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:
Lars> I have put a new version of SpaceLess in cvs, main trunk. If
Lars> there are other characters than '/' that needs to get
Lars> substituded please add them to the change string.
Lars> I would especially like to have this tested on OS/2. Linux/unix
Lars> should have no problems with it afaik.
Did you read my message from yesterday? SpaceLess should only be
needed for latex, and thus only keep characters with catcode 11 or 12.
We do not care about /, since it is _not_ supposed to be here in a
valid .lyx file name. If we want to check all file names, it should be
in another function.
Moreover, using isgraph() does not make sense, since LaTeX could not
are less about locales. The list of characters to keep is known, it
is in the latex sources.
I would propose a function like:
string SpaceLess(string const & file)
{
string name = OnlyFilename(file);
string path = OnlyPath(file);
string keep("abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"@!\"'()*+,-./0123456789:;<=>?[]`|");
string::size_type pos = 0;
while ((pos = name.find_first_not_of(change, pos)) != string::npos) {
name[pos] = '-'; //maybe another character like 'X'?
}
string temp = AddName(path, name);
return temp;
}
And I propose also to rename SpaceLess to something like ValidLaTeXName().