Re: alexp - r29602 - abiword/trunk/src/af/util/xp

From: J.M. Maurer <uwog_at_uwog.net>
Date: Sun Jun 19 2011 - 21:36:05 CEST

On Tue, 2011-03-01 at 09:51 +0100, cvs@abisource.com wrote:
> Author: alexp
> Date: 2011-03-01 09:51:39 +0100 (Tue, 01 Mar 2011)
> New Revision: 29602
>
> Modified:
> abiword/trunk/src/af/util/xp/ut_misc.cpp
> Log:
> Fixed suffix detection for filenames with dots. Potentially breaks suffixes like .abw.gz, which are not correct anyway.

What is wrong with .abw.gz? We've used that for years, and .abw.gz files
are out there... It would be a shame to break those.

Is there no better solution?

Cheers
  Marc

> Modified: abiword/trunk/src/af/util/xp/ut_misc.cpp
> ===================================================================
> --- abiword/trunk/src/af/util/xp/ut_misc.cpp 2011-03-01 08:46:14 UTC (rev 29601)
> +++ abiword/trunk/src/af/util/xp/ut_misc.cpp 2011-03-01 08:51:39 UTC (rev 29602)
> @@ -167,9 +167,10 @@
> slashpos++; // strip the leading / as well
> }
>
> - size_t dotpos = path.find_first_of('.', slashpos);
> + size_t dotpos = path.find_last_of('.');
> if (dotpos == std::string::npos)
> return "";
> + if (dotpos <= slashpos) return "";
>
> return std::string(path, dotpos, path.size() - dotpos);
> }
>
> -----------------------------------------------
> To unsubscribe from this list, send a message to
> abisource-cvs-commit-request@abisource.com with the word
> unsubscribe in the message body.
Received on Sun Jun 19 21:36:36 2011

This archive was generated by hypermail 2.1.8 : Sun Jun 19 2011 - 21:36:36 CEST