]> git.pld-linux.org Git - packages/expect.git/blame - expect-5.32.2-random.patch
- updated to 5.45.4
[packages/expect.git] / expect-5.32.2-random.patch
CommitLineData
dade3e15
AM
1diff -up expect-5.44.1.15/example/mkpasswd.orig expect-5.44.1.15/example/mkpasswd
2--- expect-5.44.1.15/example/mkpasswd.orig 2010-03-08 16:01:05.518378075 +0100
3+++ expect-5.44.1.15/example/mkpasswd 2010-03-08 16:01:27.408388162 +0100
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
This page took 0.027291 seconds and 4 git commands to generate.