On Tue, Mar 11, 2003 at 11:50:19AM -0300, Joao Luis Meloni Assirati wrote:
> I updated my patchs on inverse dvi search. Please have a look at it.

+Buffer * BufferList::getBufferFromTmppath(string const & s)
+{
+       BufferStorage::iterator it = bstore.begin();
+       BufferStorage::iterator end = bstore.end();
+       for (; it != end; ++it) {
+               if (prefixIs(s, (*it)->tmppath)) {
+                       string::size_type tmppath_s =
(*it)->tmppath.size();
+                       if(s.size() == tmppath_s || s.at(tmppath_s) == '/')
+                               return *it;

Are you sure this works with directory separators other than '/'?

Then you test whether  foo  is a prefix of  bar and have the same length.
Testing for equality should be more straightforward, shouldn't it?

Andre'


-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)

Reply via email to