]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
TestSupport: Make next_unique_name count in decimal, not unary
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 6 Feb 2015 16:59:26 +0000 (16:59 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 13 Feb 2015 14:01:46 +0000 (14:01 +0000)
Ie, we add `+<counter>' rather than an ever-longer series of `+'s.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Osstest/TestSupport.pm

index 55541b1baf6a84fb4b62257835459b40b963f5b7..8aed2856dd2cf3a4ef8c52d00b63e11c256fc30a 100644 (file)
@@ -486,7 +486,8 @@ sub target_file_exists ($$) {
 
 sub next_unique_name ($) {
     my ($fnref) = @_;
-    $$fnref .= '+';
+    my $num = $$fnref =~ s/\+([1-9]\d*)$// ? $1 : 0;
+    $$fnref .= '+'.($num+1);
 }
 
 our $target_editfile_cancel_exception =