Switch to unified view

a/src/utils/pathut.cpp b/src/utils/pathut.cpp
...
...
333
    }
333
    }
334
    return s;
334
    return s;
335
}
335
}
336
336
337
#include <smallut.h>
337
#include <smallut.h>
338
extern string path_canon(const string &is)
338
extern string path_canon(const string &is, const string* cwd)
339
{
339
{
340
    if (is.length() == 0)
340
    if (is.length() == 0)
341
    return is;
341
    return is;
342
    string s = is;
342
    string s = is;
343
    if (s[0] != '/') {
343
    if (s[0] != '/') {
344
    char buf[MAXPATHLEN];
344
    char buf[MAXPATHLEN];
345
  const char *cwdp = buf;
346
  if (cwd) {
347
      cwdp = cwd->c_str();
348
  } else {
345
    if (!getcwd(buf, MAXPATHLEN)) {
349
        if (!getcwd(buf, MAXPATHLEN)) {
346
        return string();
350
      return string();
351
      }
347
    }
352
    }
348
    s = path_cat(string(buf), s); 
353
    s = path_cat(string(cwdp), s); 
349
    }
354
    }
350
    vector<string> elems;
355
    vector<string> elems;
351
    stringToTokens(s, elems, "/");
356
    stringToTokens(s, elems, "/");
352
    vector<string> cleaned;
357
    vector<string> cleaned;
353
    for (vector<string>::const_iterator it = elems.begin(); 
358
    for (vector<string>::const_iterator it = elems.begin();