pgup/down in result list
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: fstreewalk.cpp,v 1.5 2005-11-24 07:16:16 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: fstreewalk.cpp,v 1.6 2005-12-13 12:42:59 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
#endif
|
||||
|
||||
#ifndef TEST_FSTREEWALK
|
||||
@@ -128,8 +128,7 @@ FsTreeWalker::Status FsTreeWalker::walk(const string &top,
|
||||
}
|
||||
|
||||
{
|
||||
string fn = top;
|
||||
path_cat(fn, ent->d_name);
|
||||
string fn = path_cat(top, ent->d_name);
|
||||
|
||||
struct stat st;
|
||||
int statret = (data->options & FtwFollow) ? stat(fn.c_str(), &st) :
|
||||
|
||||
+13
-1
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: pathut.cpp,v 1.5 2005-11-24 07:16:16 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: pathut.cpp,v 1.6 2005-12-13 12:42:59 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
#endif
|
||||
|
||||
#ifndef TEST_PATHUT
|
||||
@@ -12,6 +12,18 @@ static char rcsid[] = "@(#$Id: pathut.cpp,v 1.5 2005-11-24 07:16:16 dockes Exp $
|
||||
using std::string;
|
||||
#endif /* NO_NAMESPACES */
|
||||
|
||||
void path_catslash(std::string &s) {
|
||||
if (s.empty() || s[s.length() - 1] != '/')
|
||||
s += '/';
|
||||
}
|
||||
|
||||
std::string path_cat(const std::string &s1, const std::string &s2) {
|
||||
std::string res = s1;
|
||||
path_catslash(res);
|
||||
res += s2;
|
||||
return res;
|
||||
}
|
||||
|
||||
string path_getfather(const string &s) {
|
||||
string father = s;
|
||||
|
||||
|
||||
+3
-10
@@ -1,18 +1,11 @@
|
||||
#ifndef _PATHUT_H_INCLUDED_
|
||||
#define _PATHUT_H_INCLUDED_
|
||||
/* @(#$Id: pathut.h,v 1.3 2005-01-31 14:31:10 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
/* @(#$Id: pathut.h,v 1.4 2005-12-13 12:42:59 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
|
||||
#include <string>
|
||||
|
||||
inline void path_catslash(std::string &s) {
|
||||
if (s.empty() || s[s.length() - 1] != '/')
|
||||
s += '/';
|
||||
}
|
||||
inline void path_cat(std::string &s1, const std::string &s2) {
|
||||
path_catslash(s1);
|
||||
s1 += s2;
|
||||
}
|
||||
|
||||
extern void path_catslash(std::string &s);
|
||||
extern std::string path_cat(const std::string &s1, const std::string &s2);
|
||||
extern std::string path_getsimple(const std::string &s);
|
||||
extern std::string path_getfather(const std::string &s);
|
||||
extern std::string path_home();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.10 2005-11-25 14:36:45 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.11 2005-12-13 12:43:00 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
#endif
|
||||
#ifndef TEST_SMALLUT
|
||||
#include <string>
|
||||
@@ -27,8 +27,8 @@ bool maketmpdir(string& tdir)
|
||||
tmpdir = getenv("TMPDIR");
|
||||
if (!tmpdir)
|
||||
tmpdir = "/tmp";
|
||||
tdir = tmpdir;
|
||||
path_cat(tdir, "rcltmpXXXXXX");
|
||||
tdir = path_cat(tmpdir, "rcltmpXXXXXX");
|
||||
|
||||
{
|
||||
char *cp = strdup(tdir.c_str());
|
||||
if (!cp) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: wipedir.cpp,v 1.3 2005-11-24 07:16:16 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: wipedir.cpp,v 1.4 2005-12-13 12:43:00 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
#endif
|
||||
|
||||
#ifndef TEST_WIPEDIR
|
||||
@@ -50,8 +50,7 @@ int wipedir(const string& dir)
|
||||
if (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, ".."))
|
||||
continue;
|
||||
|
||||
string fn = dir;
|
||||
path_cat(fn, ent->d_name);
|
||||
string fn = path_cat(dir, ent->d_name);
|
||||
|
||||
struct stat st;
|
||||
int statret = stat(fn.c_str(), &st);
|
||||
|
||||
Reference in New Issue
Block a user