mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 20:38:08 +01:00
notmuch: Fix setup so that accepting the default mail path works.
The recent change from GIOChannel to getline, (with a semantic change of the newline terminator now being included in the result that setup_command sees), broke this.
This commit is contained in:
parent
7f254fb603
commit
28fa0bc2d6
1 changed files with 6 additions and 2 deletions
|
@ -289,13 +289,17 @@ setup_command (int argc, char *argv[])
|
||||||
getline (&mail_directory, &line_size, stdin);
|
getline (&mail_directory, &line_size, stdin);
|
||||||
printf ("\n");
|
printf ("\n");
|
||||||
|
|
||||||
|
if (mail_directory &&
|
||||||
|
mail_directory[strlen(mail_directory)-1] == '\n')
|
||||||
|
{
|
||||||
|
mail_directory[strlen(mail_directory)-1] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
if (mail_directory == NULL || strlen (mail_directory) == 0) {
|
if (mail_directory == NULL || strlen (mail_directory) == 0) {
|
||||||
if (mail_directory)
|
if (mail_directory)
|
||||||
free (mail_directory);
|
free (mail_directory);
|
||||||
mail_directory = default_path;
|
mail_directory = default_path;
|
||||||
} else {
|
} else {
|
||||||
if (mail_directory[strlen(mail_directory)-1] == '\n')
|
|
||||||
mail_directory[strlen(mail_directory)-1] = '\0';
|
|
||||||
/* XXX: Instead of telling the user to use an environment
|
/* XXX: Instead of telling the user to use an environment
|
||||||
* variable here, we should really be writing out a configuration
|
* variable here, we should really be writing out a configuration
|
||||||
* file and loading that on the next run. */
|
* file and loading that on the next run. */
|
||||||
|
|
Loading…
Reference in a new issue