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.
getline (&mail_directory, &line_size, stdin);
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)
free (mail_directory);
mail_directory = default_path;
} 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
* variable here, we should really be writing out a configuration
* file and loading that on the next run. */