From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 11:32:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D61C3106564A; Sun, 6 Jun 2010 11:32:38 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C595E8FC0A; Sun, 6 Jun 2010 11:32:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o56BWcA3028921; Sun, 6 Jun 2010 11:32:38 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56BWcVK028919; Sun, 6 Jun 2010 11:32:38 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201006061132.o56BWcVK028919@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 6 Jun 2010 11:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208867 - head/usr.bin/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 11:32:38 -0000 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 (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);