svn commit: r208867 - head/usr.bin/dc

Gabor Kovesdan gabor at FreeBSD.org
Sun Jun 6 11:32:38 UTC 2010


Author: gabor
Date: Sun Jun  6 11:32:38 2010
New Revision: 208867
URL: http://svn.freebsd.org/changeset/base/208867

Log:
  - Fig segmentation fault
  
  Submitted by:	Hizel Ildar <hizel at vyborg.ru> (via current@)

Modified:
  head/usr.bin/dc/dc.c

Modified: head/usr.bin/dc/dc.c
==============================================================================
--- head/usr.bin/dc/dc.c	Sun Jun  6 06:07:44 2010	(r208866)
+++ head/usr.bin/dc/dc.c	Sun Jun  6 11:32:38 2010	(r208867)
@@ -87,12 +87,16 @@ main(int argc, char *argv[])
 	while ((ch = getopt_long(argc, argv, "e:f:Vx", long_options, NULL)) != -1) {
 		switch (ch) {
 		case 'e':
+			if(!preproc_done)
+				init_bmachine(extended_regs);
 			src_setstring(&src, optarg);
 			reset_bmachine(&src);
 			eval();
 			preproc_done = true;
 			break;
 		case 'f':
+			if(!preproc_done)
+				init_bmachine(extended_regs);
 			procfile(optarg);
 			preproc_done = true;
 			break;
@@ -114,7 +118,8 @@ main(int argc, char *argv[])
 	argc -= optind;
 	argv += optind;
 
-	init_bmachine(extended_regs);
+	if (!preproc_done)
+		init_bmachine(extended_regs);
 	setlinebuf(stdout);
 	setlinebuf(stderr);
 


More information about the svn-src-all mailing list