Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

double slashes in output paths #37

Open
greg-minshall opened this issue Jul 17, 2022 · 3 comments
Open

double slashes in output paths #37

greg-minshall opened this issue Jul 17, 2022 · 3 comments

Comments

@greg-minshall
Copy link

hi. when i run mairix -r, i get an extra slash after ~/Mail/.

bash apollo2 (master): {49759} mairix -r -f ~/Mail/.mairix/config mh-e | head
/home/minshall/Mail//_06/_05/811
...

my config file looks like this:

bash apollo2 (master): {49760} cat ~/Mail/.mairix/config
base=~/Mail

# List of folders that should be indexed. 3 dots at the end means there
# are subfolders within the folder
mh=...
omit=**/mhe-index/**

database=~/Mail/.mairix/database

and, i index like this:

#!/bin/bash

mairix -f ~/Mail/.mairix/config

i'm running mairix 0.24 (but this problem has been going on for maybe six years?).

any thoughts?

@greg-minshall
Copy link
Author

by the way, for what it's worth, i seem to have the following change in my copy of the git repository from 2012 (i've now rebased it on the current master):

1 file changed, 3 insertions(+)
mbox.c | 3 +++

modified   mbox.c
@@ -757,6 +757,9 @@ static void handle_one_path(const char *folder_base,
   last_comp = last_slash ? (last_slash + 1) : full_path;
   if ((len >= 4) && !strcmp(full_path + (len - 3), "...")) {
     full_path[len - 3] = '\0';
+    if (full_path[len - 4] == '/') { /* in case no name specified */
+        full_path[len - 4] = '\0';
+    }
     if (is_wild(last_comp)) {
       handle_wild(full_path, base_len, last_comp, list, append_deep, methods, omit_globs);
     } else {

i apologize -- i no longer remember what "in case no name specified" refers to. :)

this seems, for me, to fix my problem. does it help see what i, or mairix, might be doing wrong?

@vandry
Copy link
Collaborator

vandry commented Oct 1, 2022

The comment at the top of the function (which seems to be the closest thing to documentation that this feature has) does not list plain ... as supported:

  /* Valid syntaxen ([.]=optional):
   * [xxx/]foo : single path
   * [xxx/]foo... : if foo is a file, as before; if a directory, every ordinary file under it
   * [xxx/]wild : any single path matching the wildcard
   * [xxx/]wild... : consider each match of the wildcard by the rule 2 lines above

You have ... with no foo or wild before it. Yet it seems to work for you modulo the doubled slash character, so I guess that's good for you. Your comment "in case no name specified" seems to refer to exactly this: there is no filename before the ....

That being said, the doubled slash seems cosmetic to me. Does it cause you any bugs later on down? If not, then I propose to leave it alone.

@greg-minshall
Copy link
Author

hi. thanks. yes, later on code in another package (mh-e, emacs e-mail system) removes everything up to one of the slashes, and then decides to look in nmh folder +/inbox (for example), which is invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants