[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Suspicious code in SciEdit

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Mon, 05 Sep 2011 20:23:34 +0200

On 05.09.2011 14:46, Dmitry wrote:
> Hey.
>
> Currently CSciEdit::MarkEnteredBugID() has a
>
> for (tr1::sregex_iterator it(s.begin(), s.end(), regCheck, start_pos != 0 ? tr1::regex_constants::match_not_bol : tr1::regex_constants::match_default); it != end; ++it)
>
> loop which iteration starts with
>
> pos = (LONG)it->position(0);
>
> and then near the end of iteration there's this assignment:
>
> pos = (LONG)(it->position(0) + matchedString.size());
>
> Now "pos" value is never used in between. It makes no sense to assign the value twice. Something is wrong here. Could you please address it?

It doesn't make sense if you don't set breakpoints :)
I added that statement to help with debugging so I could check the value
in an easy way, but then forgot to remove it later.

Fixed in r21944.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2835659
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2011-09-05 20:23:43 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.