On Mon, Nov 30, 2020 at 10:01:43PM +0100, Andreas Grapentin wrote:
To determine the SyncState directory, if not set explicitly
- expand $XDG_DATA_HOME from the environment, falling back to
  $HOME/.local/share/ as per the specification
- check whether XDG_DATA_HOME/mbsync exists and is a directory, and if not
- fall back to ~/.mbsync

i would expect the XDG location to be the new default and therefore the fallback (the assumption is that if both directories are present for some reason, it's ok if the legacy location wins).

The patch also extends the bevior of mbsync after a path to the
syncstate directory has been determined (regardless of where the path
came from) by adding a check for whether the chosen path is invalid.

doesn't work, because the directory should be created on-demand.
what's more, SyncState doesn't even have to be only a directory.
see prepare_state().

+               if ((stat_res == -1 && errno == ENOENT) || !S_ISDIR(s.st_mode)) 
{

you'd need to use the ternary operator here.

p.s.: the other patch looks fine now, sans some nits i'll flush out myself before committing.


_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to