Ralph Seichter <ra...@ml.seichter.de> writes:
> +      strcmp (key, "database.backup_path") == 0) {
> +     if (val[0] == '~')
> +         /* Explicit syntax for "~/some/relative/path" */
> +         expanded_val = talloc_asprintf (ctx, "%s%s", getenv ("HOME"), 
> &val[1]);

what should we do if val[1] != '/'?  I think that is what derailed us
last time. Do we think it's worth checking the passwd database for user
names? what about things like '~.foo' ?

> +     else if (val[0] != '/')
> +         /* Implicit syntax for "some/relative/path" */
> +         expanded_val = talloc_asprintf (ctx, "%s/%s", getenv ("HOME"), val);
> +    }
> +    if (! expanded_val)
> +     /* Catchall, no special expansion */
>       expanded_val = talloc_strdup (ctx, val);
>  
>      return expanded_val;

If we do decide to make this change, obviously we'll need to update the
documentation and (maybe less obviously) tests.
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org

Reply via email to