diff options
author | Matthias Kramm <kramm@quiss.org> | 2012-03-07 16:29:01 -0800 |
---|---|---|
committer | Matthias Kramm <kramm@quiss.org> | 2012-03-07 16:29:01 -0800 |
commit | d3af16b827bb420d959a59325102fd3aa2cab8c2 (patch) | |
tree | 07190101fa6f8d7766bebbd7058079ddc48a1759 | |
parent | 2cba9f54c7806e6acbbb3901a06be4de4f1c65b2 (diff) |
initialize random generation for pdftotext and pdfinfo, as well
-rw-r--r-- | lib/pdf/xpdf-changes.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/lib/pdf/xpdf-changes.patch b/lib/pdf/xpdf-changes.patch index b3af49de..23d19a42 100644 --- a/lib/pdf/xpdf-changes.patch +++ b/lib/pdf/xpdf-changes.patch @@ -2275,3 +2275,55 @@ // parse args ok = parseArgs(argDesc, &argc, argv); if (mono && gray) { +--- xpdf/pdftotext.cc.orig 2012-03-07 16:09:56.000000000 -0800 ++++ xpdf/pdftotext.cc 2012-03-07 16:21:49.000000000 -0800 +@@ -11,6 +11,9 @@ + #include <stdlib.h> + #include <stddef.h> + #include <string.h> ++#include <time.h> ++#include <unistd.h> ++#include <sys/types.h> + #include "parseargs.h" + #include "GString.h" + #include "gmem.h" +@@ -101,6 +104,13 @@ + + exitCode = 99; + ++#ifdef HAVE_LRAND48 ++ srand48(time(0)*getpid()); ++#endif ++#ifdef HAVE_RAND ++ srand(time(0)*getpid()); ++#endif ++ + // parse args + ok = parseArgs(argDesc, &argc, argv); + if (!ok || argc < 2 || argc > 3 || printVersion || printHelp) { +--- xpdf/pdfinfo.cc.orig 2012-03-07 16:09:56.000000000 -0800 ++++ xpdf/pdfinfo.cc 2012-03-07 16:21:40.000000000 -0800 +@@ -12,6 +12,9 @@ + #include <stddef.h> + #include <string.h> + #include <time.h> ++#include <unistd.h> ++#include <sys/types.h> ++#include <time.h> + #include <math.h> + #include "parseargs.h" + #include "GString.h" +@@ -95,6 +98,13 @@ + + exitCode = 99; + ++#ifdef HAVE_LRAND48 ++ srand48(time(0)*getpid()); ++#endif ++#ifdef HAVE_RAND ++ srand(time(0)*getpid()); ++#endif ++ + // parse args + ok = parseArgs(argDesc, &argc, argv); + if (!ok || argc != 2 || printVersion || printHelp) { |