<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On Jun 23, 2015, at 3:24 AM, <a href="mailto:chunyang@macports.org" class="">chunyang@macports.org</a> wrote:<div class=""><br class=""><div><blockquote type="cite" class=""><div id="patch" style="width: 1046px; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="modfile" style="border: 1px solid rgb(204, 204, 204); margin: 10px 0px;"><pre class="diff" style="padding: 0px 0px 10px; line-height: 1.2em; margin: 0px; width: 1044px; background-color: rgb(238, 238, 238); overflow: auto; background-position: initial initial; background-repeat: initial initial;"><span style="display: block; padding: 0px 10px;" class=""><ins style="background-color: rgb(221, 255, 221); text-decoration: none; display: block; padding: 0px 10px; background-position: initial initial; background-repeat: initial initial;" class="">+    if {[regexp {[0-9]+([.-][0-9]+)+} $v version]} {
+        if {[string length $version] &lt; [string length $v]} {
+            set tag_prefix [string range $v 0 [expr [string first $version $v] -1]]
+        }
+    }
</ins></span></pre></div></div></blockquote><div>You might be able to do this a bit more cleanly with "regexp -indices".</div><div><br class=""></div><div>If the "regexp" call does match, how can $version ever have the same length as $v?</div><div><br class=""></div><blockquote type="cite" class=""><div id="patch" style="width: 1046px; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="modfile" style="border: 1px solid rgb(204, 204, 204); margin: 10px 0px;"><pre class="diff" style="padding: 0px 0px 10px; line-height: 1.2em; margin: 0px; width: 1044px; background-color: rgb(238, 238, 238); overflow: auto; background-position: initial initial; background-repeat: initial initial;"><span style="display: block; padding: 0px 10px;" class=""><ins style="background-color: rgb(221, 255, 221); text-decoration: none; display: block; padding: 0px 10px; background-position: initial initial; background-repeat: initial initial;" class="">+    return [concat $author $project [parse_tarball_name $tarball]]
</ins></span></pre></div></div></blockquote></div>You should probably use the "list" command here instead of "concat". The "concat" command just concatenates its arguments without ensuring that the result is a well-formed Tcl list. You can't be sure that $author, $project, and $tarball are clean.</div><div class=""><br class=""></div><div class="">vq</div></body></html>