From: Tomi Ollila <tomi.ollila@iki.fi>
To: David Edmondson <dme@dme.org>, Bijan Chokoufe <bijan@chokoufe.com>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH] config: Expand ~ to $HOME
Date: Wed, 11 May 2016 23:16:39 +0300 [thread overview]
Message-ID: <m2zirw4afs.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <m2mvnw8idg.heart-of-gold@dme.org>
On Wed, May 11 2016, David Edmondson <dme@dme.org> wrote:
> On Wed, May 11 2016, Bijan Chokoufe wrote:
>
>> so what would be the spec for handling ~user?
>
> Look up "user" in the password file and replace "~user" with their home
> directory. See getpwnam().
>
>> As Tomi pointed out ~foo will point to different folders if set by user
>> 'foo' or by user 'bar'.
>
> ~foo means "the home directory of user foo", independent of who is using
> it, so it will be the same when used by both user foo and user bar.
>
3 things more if you're cooking new patch
1) use git send-email -- then it is easier to apply.
2) on talloc() use config instead of NULL to lessen unfreed memory
at program exit
3) talloc_free() old config->database_path and set it to point the new
value.
Tomi
>> To what folder should it point and where do I get this information?
>>
>> David Edmondson <dme@dme.org> schrieb am Di., 10. Mai 2016 um 10:22 Uhr:
>>
>>> On Mon, May 09 2016, Bijan Chokoufe Nejad wrote:
>>>
>>> >> ~user is ~ in case you're 'user' -- except that now that I think of it
>>> >> ~user could read home directory from /etc/passwd and not using $HOME.
>>> >> If you're 'eve', then ~alice should definitely be different than ~
>>> >
>>> > OK I see. I never used ~user instead of ~ and don't see any advantage in
>>> using
>>> > ~user but good to know it's there.
>>>
>>> A solution that supports ~ but not ~user seems incomplete.
>>>
prev parent reply other threads:[~2016-05-11 20:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-08 15:49 [PATCH] config: Expand ~ to $HOME Bijan Chokoufe Nejad
2016-05-08 16:47 ` Tomi Ollila
2016-05-08 18:50 ` Bijan Chokoufe
2016-05-09 7:54 ` Tomi Ollila
2016-05-09 8:40 ` Tomi Ollila
2016-05-09 21:57 ` Bijan Chokoufe Nejad
2016-05-10 8:22 ` David Edmondson
2016-05-11 19:17 ` Bijan Chokoufe
2016-05-11 20:11 ` David Edmondson
2016-05-11 20:16 ` Tomi Ollila [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2zirw4afs.fsf@guru.guru-group.fi \
--to=tomi.ollila@iki.fi \
--cc=bijan@chokoufe.com \
--cc=dme@dme.org \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).