[macports-base] branch master updated: livecheck: Stop on negative regexp offset

Jeremy Huddleston Sequoia jeremyhu at macports.org
Sat Jan 28 00:19:23 UTC 2017


Sounds worthy of cherry-picking into release-2.4 for an eventual 2.4.1.

--Jeremy

> On Jan 27, 2017, at 07:56, Rainer Müller <raimue at macports.org> wrote:
> 
> Rainer Müller (raimue) pushed a commit to branch master
> in repository macports-base.
> 
> 
> https://github.com/macports/macports-base/commit/d33a8a0dfbc68614a5b20cc870245f53a849473b
> 
> The following commit(s) were added to refs/heads/master by this push:
> 
>      new d33a8a0  livecheck: Stop on negative regexp offset
> 
> d33a8a0 is described below
> 
> 
> commit d33a8a0dfbc68614a5b20cc870245f53a849473b
> 
> Author: Rainer Müller <raimue at macports.org>
> AuthorDate: Fri Jan 27 16:49:55 2017 +0100
> 
> 
>     livecheck: Stop on negative regexp offset
> 
>     
> 
>     If the given regex is an empty string, regexp returns indices {0 -1}.
> 
>     This -1 was taken as the offset where to start applying the regex again,
> 
>     leading to an infinite loop handling the same line over and over.
> 
> ---
>  src/port1.0/portlivecheck.tcl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> diff --git a/src/port1.0/portlivecheck.tcl b/src/port1.0/portlivecheck.tcl
> 
> index 8fae97c..486d959 100644
> 
> --- a/src/port1.0/portlivecheck.tcl
> 
> +++ b/src/port1.0/portlivecheck.tcl
> 
> @@ -172,7 +172,7 @@ proc portlivecheck::livecheck_main {args} {
> 
>                      set updated_version 0
>                      while {[gets $chan line] >= 0} {
>                          set lastoff 0
> 
> -                        while {[regexp -start $lastoff -indices $the_re $line offsets]} {
> 
> +                        while {$lastoff >= 0 && [regexp -start $lastoff -indices $the_re $line offsets]} {
> 
>                              regexp -start $lastoff $the_re $line matched upver
>                              set foundmatch 1
>                              if {$updated_version == 0 || [vercmp $upver $updated_version] > 0} {
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4465 bytes
Desc: not available
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20170127/f384b15a/attachment.bin>


More information about the macports-dev mailing list