lib: follow symlinks in maildirs

Until now, mu would _not_ follow symlinks; with these changes, we do.

There were some complications with that ~10 years ago, but I forgot the
details. So let's re-enable. At least one thing is in place now: moving
between file systems.

Fixes #1489
Fixes #1628 (technically, this came with slightly earlier commit)
This commit is contained in:
Dirk-Jan C. Binnema
2020-05-26 19:07:56 +03:00
parent 015fae7b1a
commit fdac81e023
7 changed files with 65 additions and 48 deletions

View File

@ -340,14 +340,21 @@ mu_util_play (const char *path, gboolean allow_local, gboolean allow_remote,
unsigned char
mu_util_get_dtype_with_lstat (const char *path)
mu_util_get_dtype (const char *path, gboolean use_lstat)
{
int res;
struct stat statbuf;
g_return_val_if_fail (path, DT_UNKNOWN);
if (lstat (path, &statbuf) != 0) {
g_warning ("stat failed on %s: %s", path, strerror(errno));
if (use_lstat)
res = lstat (path, &statbuf);
else
res = stat (path, &statbuf);
if (res != 0) {
g_warning ("%sstat failed on %s: %s",
use_lstat ? "l" : "", path, strerror(errno));
return DT_UNKNOWN;
}
@ -363,6 +370,7 @@ mu_util_get_dtype_with_lstat (const char *path)
}
gboolean
mu_util_locale_is_utf8 (void)
{