OSDN Git Service

fix clean-store function.
authorvisor <visor@users.sourceforge.jp>
Mon, 2 Nov 2015 14:20:49 +0000 (23:20 +0900)
committervisor <visor@users.sourceforge.jp>
Mon, 2 Nov 2015 14:20:49 +0000 (23:20 +0900)
modules/ml-store.cc
modules/ml-wiki.cc

index 789ae55..8ea65cc 100644 (file)
@@ -315,12 +315,8 @@ static void  cleanStore (int span, MlEnv* mlenv) {
     int  i;
     ustring  u;
     char*  argv1[4];
-//    char*  argv2[4];
 
     limit = now () - span;
-#if 0
-    std::cerr << "limit:" << strYMD (limit) << "\n";
-#endif /* DEBUG */
     openDB (db, lock, mlenv);
 
     db.initeach ();
@@ -328,9 +324,6 @@ static void  cleanStore (int span, MlEnv* mlenv) {
        if (key.size > 1) {
            t = strtol ((char*)val.data, NULL, 10);
            if (t > 0 && t < limit) {
-#if 0
-               std::cerr << strYMD (t) << "\n";
-#endif /* DEBUG */
                xs.push_back (new ustring ((char*)key.data, key.size));
                pathRec (&val, subdir, savedir);
                if (subdir)
@@ -350,21 +343,15 @@ static void  cleanStore (int span, MlEnv* mlenv) {
     argv1[0] = (char*)cmd_rm;
     argv1[1] = (char*)"-fr";
     argv1[3] = NULL;
-//    argv2[0] = (char*)cmd_rmdir;
-//    argv2[2] = NULL;
     for (i = 0; i < path.size (); i ++) {
        assert (path[i].size () > 0);
        u = mlenv->env->path_to_store () + path[i];
        argv1[2] = noconst_char (u.c_str ());
        exec_cmd (argv1);
-       pdir (u);
-//     argv2[1] = noconst_char (u.c_str ());
-//     exec_cmd (argv2);
+       pdir (u);                       // レベル1
+       rmdir (u.c_str ());
+       pdir (u);                       // レベル2
        rmdir (u.c_str ());
-#ifdef DEBUG
-//     std::cerr << argv1[0] << " " << argv1[1] << " " << argv1[2] << "\n";
-//     std::cerr << "rmdir " << u << "\n";
-#endif /* DEBUG */
     }
 }
 
index 926496e..4c7c35c 100644 (file)
@@ -314,6 +314,8 @@ MNode*  ml_get_wiki_command (MNode* cell, MlEnv* mlenv) {
 ===wiki-guestuser-function===
  (wiki-guestuser-function FNAME...) -> NIL
 
+Wikiコマンドの一般ユーザへの実行許可。
+
 */
 //#AFUNC       wiki-guestuser-function ml_wiki_guestuser_function
 MNode*  ml_wiki_guestuser_function (MNode* cell, MlEnv* mlenv) {