aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2011-05-03 11:37:03 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2011-05-03 11:37:03 +0000
commitbd726c262eacb8675c29121f040452106671e929 (patch)
tree3d195e2a98d7d1d827a1d40f49e6529b3bfc6825 /main.c
parentd9859a0e4b8744c01f13cf391ee5cfbf57c5e818 (diff)
downloadsrc-bd726c262eacb8675c29121f040452106671e929.tar.gz
src-bd726c262eacb8675c29121f040452106671e929.zip
Vendor import of bwk's 1-May-2011 release.vendor/one-true-awk/20110501
Notes
Notes: svn path=/vendor/one-true-awk/dist/; revision=221379 svn path=/vendor/one-true-awk/20110501/; revision=221380; tag=vendor/one-true-awk/20110501
Diffstat (limited to 'main.c')
-rw-r--r--main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/main.c b/main.c
index 3bc25a579fec..a125bc1eb1fb 100644
--- a/main.c
+++ b/main.c
@@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
-const char *version = "version 20091126";
+const char *version = "version 20110501";
#define DEBUG
#include <stdio.h>
@@ -38,6 +38,7 @@ extern char **environ;
extern int nfields;
int dbg = 0;
+Awkfloat srand_seed = 1;
char *cmdname; /* gets argv[0] for error messages */
extern FILE *yyin; /* lex input file */
char *lexprog; /* points to program argument if it exists */
@@ -67,6 +68,10 @@ int main(int argc, char *argv[])
exit(1);
}
signal(SIGFPE, fpecatch);
+
+ srand_seed = 1;
+ srand(srand_seed);
+
yyin = NULL;
symtab = makesymtab(NSYMTAB/NSYMTAB);
while (argc > 1 && argv[1][0] == '-' && argv[1][1] != '\0') {
@@ -113,6 +118,8 @@ int main(int argc, char *argv[])
case 'v': /* -v a=1 to be done NOW. one -v for each */
if (argv[1][2] == '\0' && --argc > 1 && isclvar((++argv)[1]))
setclvar(argv[1]);
+ else if (argv[1][2] != '\0')
+ setclvar(&argv[1][2]);
break;
case 'd':
dbg = atoi(&argv[1][2]);