]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - expect/patches/expect-5.32.2-random.patch
Change file layout of the makefiles.
[people/ms/ipfire-3.x.git] / expect / patches / expect-5.32.2-random.patch
1 diff -up expect-5.43/example/mkpasswd.random expect-5.43/example/mkpasswd
2 --- expect-5.43/example/mkpasswd.random 2004-12-07 00:38:21.000000000 +0100
3 +++ expect-5.43/example/mkpasswd 2008-09-25 12:27:19.000000000 +0200
4 @@ -92,7 +92,14 @@ proc insert {pvar char} {
5 }
6
7 proc rand {m} {
8 - expr {int($m*rand())}
9 + set device /dev/urandom ;# /dev/random can block
10 + set fileId [open $device r]
11 + binary scan [read $fileId 4] i1 number
12 + set clipped [expr $number % $m]
13 +# puts "number is $number"
14 +# puts "clipped is $clipped"
15 + close $fileId
16 + return $clipped
17 }
18
19 # choose left or right starting hand