Re: [evolution-patches] Exchange, fixes #316414



> -       pub_name = strchr (folder_name, '/');
> +       pub_name = strrchr (folder_name, '/');
>         path = g_build_filename ("/favorites", pub_name, NULL);

Hmm, are the folder names that are being manipulated here pathnames in
the file system, or  "abstract" Unix-like pathnames (like in URIs or
GConf paths), where the path component separator is always '/' on all
platforms?

If they actually are pathnames from the file system, then for improved
Win32 portability, use g_basename(folder_name) instead of
strrchr(pathname, '/'), if there is a risk that the way the pathname has
been constructed means it might have '\\ separators.

On the other hand, if they are "abstract" pathnames, do use strrchr().
In theory then using g_build_filename() to construct such paths are
wrong, but in this case, where there already is a '/' prefixing the
pub_name, on Win32 g_build_filename() will keep the '/' and not change
it into the more canonical '\\'.

Hmm, actually, forget all the above for now. Only actual testing of the
evolution-exchange component on Win32 against an Exchange server will
reveal what actually happens here and what kinds of paths might be
passed around and how they are used later... and then any needed Win32
portability changes will be pretty self-evident.

--tml





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]