+1999-11-02 Lars Gullik Bjønnes <larsbj@lyx.org>
+
+ * src/support/lyxstring.C (find): remove bogus assert and return
+ npos for the same condition.
+
1999-11-01 Lars Gullik Bjønnes <larsbj@lyx.org>
* added patch for OS/2 from SMiyata.
string path = OnlyPath(file);
for (string::size_type i = 0; i < name.length(); ++i) {
- name[i] &= 0x7f;
+ name[i] &= 0x7f; // set 8th bit to 0
if (!isalnum(name[i]) && name[i] != '.')
name[i] = '_';
}
FilePtr fp(path, FilePtr::update);
if (!fp()) {
if ((errno == EACCES) || (errno == EROFS)) {
- //fp = FilePtr(path, FilePtr::read);
fp.reopen(path, FilePtr::read);
if (fp()) {
return 0;
{
string real_file, path_element;
bool notfound = true;
- string tmppath=split(path, path_element, ';');
+ string tmppath = split(path, path_element, ';');
while (notfound && !path_element.empty()) {
path_element = CleanupPath(path_element);
static
int DeleteAllFilesInDir (string const & path)
{
- DIR * dir;
struct dirent * de;
- dir = opendir(path.c_str());
+ DIR * dir = opendir(path.c_str());
if (!dir) {
WriteFSAlert (_("Error! Cannot open directory:"), path);
return -1;
if (!path2.empty()){
int p2start = path2.find_first_not_of('/');
- //while (path2[p2start] == '/') ++p2start;
int p2end = path2.find_last_not_of('/');
- //while (path2[p2end] == '/') --p2end;
string tmp = path2.substr(p2start, p2end - p2start + 1);
buf += tmp + '/';
return prefix + relhome;
}
+
bool LyXReadLink(string const & File, string & Link)
{
char LinkBuffer[512];
lyxstring::size_type lyxstring::find(value_type const * s, size_type i) const
{
Assert(s);
- if (!rep->sz) return npos;
+ if (!rep->sz || i >= rep->sz) return npos;
- Assert(i < rep->sz);
TestlyxstringInvariant(this);
if (!s || !*s) return npos;