From owner-freebsd-ports Sun Oct 27 1: 8:17 2002 Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA61237B404 for ; Sun, 27 Oct 2002 01:08:14 -0700 (PDT) Received: from gatesrv.RZ.UniBw-Muenchen.de (unknown [137.193.11.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79D4543E6E for ; Sun, 27 Oct 2002 01:08:13 -0700 (PDT) (envelope-from lizard@informatik.unibw-muenchen.de) Received: from nemesis.informatik.unibw-muenchen.de (nemesis.Informatik.UniBw-Muenchen.de [137.193.60.30]) by gatesrv.RZ.UniBw-Muenchen.de (8.11.2/8.11.2) with ESMTP id g9R7hTV06594; Sun, 27 Oct 2002 08:43:30 +0100 (MET) Received: from localhost (localhost.informatik.unibw-muenchen.de [127.0.0.1]) by nemesis.informatik.unibw-muenchen.de (Postfix) with ESMTP id E74285A545; Sun, 27 Oct 2002 08:43:27 +0100 (CET) Received: by nemesis.informatik.unibw-muenchen.de (Postfix, from userid 1001) id 34F6B5A544; Sun, 27 Oct 2002 08:43:27 +0100 (CET) Date: Sun, 27 Oct 2002 08:43:27 +0100 From: Oliver Braun To: Kris Kennaway Cc: Steve Kargl , freebsd-ports@FreeBSD.ORG Subject: Re: FILE *in = stdin problem in FreeBSD-current. Message-ID: <20021027074327.GA35627@informatik.unibw-muenchen.de> Mail-Followup-To: Oliver Braun , Kris Kennaway , Steve Kargl , freebsd-ports@FreeBSD.ORG References: <20021026163320.GA28436@troutmask.apl.washington.edu> <20021027005304.GB16148@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline In-Reply-To: <20021027005304.GB16148@xor.obsecurity.org> User-Agent: Mutt/1.4i X-PGP-Key: http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0xEF25B1BA X-PGP-Key-Alternative: finger obraun@freebsd.org X-PGP-Fingerprint: 6A3B 042A 732E 17E4 B6E7 3EAF C0B1 6B7D EF25 B1BA X-Accept-Language: de en X-Editor: Vim-601 http://www.vim.org/ X-Virus-Scanned: by AMaViS snapshot-20020531 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Kris Kennaway [2002-10-26 17:53 -0700]: > On Sat, Oct 26, 2002 at 09:33:20AM -0700, Steve Kargl wrote: > > Line 36 of dec10io.usr is "FILE *input=3Dstdin;". =20 > > stdio.h is properly included in the source where we have > >=20 > > extern FILE *__stdinp; > > #define stdin __stdinp > >=20 > > How is handled? > You need to initialize the variable at runtime, not statically. If > the program contains main() you can do it then; if it's a library I > don't know a good way to fix it. If it's a library the only solution I know is to initialize the variable with NULL and insert something like the following before *any* usage: if (var =3D=3D NULL) {var =3D stdin;} Don't know if it's sufficient in all cases. Regards, Olli --=20 {- IST & IIS _ INF _ UniBwM :: obraun@informatik.unibw-muenchen.de -} {- Tele-Consulting GmbH :: obraun@Tele-Consulting.com -} {- FreeBSD Commmitter :: obraun@FreeBSD.org -} --7AUc2qLy4jB3hD7Z Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iD8DBQE9u5kfwLFrfe8lsboRAupXAJwOy6sigmi8i574WbsUKuToBXwV4gCg1OaC gswXBbocP5SeqEuFwn0vfjg= =0ENs -----END PGP SIGNATURE----- --7AUc2qLy4jB3hD7Z-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message