Properly zero-pad the day-of-year part of the win32 build number
authorMagnus Hagander <[email protected]>
Thu, 31 Jan 2013 14:08:05 +0000 (15:08 +0100)
committerMagnus Hagander <[email protected]>
Thu, 31 Jan 2013 14:09:25 +0000 (15:09 +0100)
This ensure the version number increases over time. The first three digits
in the version number is still set to the actual PostgreSQL version
number, but the last one is intended to be an ever increasing build number,
which previosly failed when it changed between 1, 2 and 3 digits long values.

Noted by Deepak

src/tools/msvc/Project.pm

index f2e3f5fdb92275103ead6c86c481df00ac6cbd2e..fc9cfa14b0dbf5db20c7b8585c0d868962bbcecd 100644 (file)
@@ -300,7 +300,7 @@ sub AddResourceFile
     my ($self, $dir, $desc, $ico) = @_;
 
     my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
-    my $d = ($year - 100) . "$yday";
+    my $d = sprintf("%02d%03d", ($year - 100), $yday);
 
     if (Solution::IsNewer("$dir\\win32ver.rc",'src\port\win32ver.rc'))
     {