From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 8FAD777D0D for ; Wed, 13 Jan 2016 11:22:57 -0800 (PST) Received: by mail-io0-x232.google.com with SMTP id 77so397824523ioc.2 for ; Wed, 13 Jan 2016 11:23:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=geoffair-info.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Yf6NwZ7pXwwv/8R1dwnZbTFrKKAchZdKJYChc9TfUZs=; b=Cl/EeBnzM8foTC26i+xhXxcOM94G9gBN0m7+w+Q0xAVRIRX6h0KAPNXgCMCPav2GWB EPSc6fLMpIRaGibWbunfS3VYptifR18MiHOGec7bM35Q14C74aHosuvxqCeQ+wYqFxkB 6Ky0KqTH9wc0ncZrxp8pU5m0r5rKyrNtS1Gy0K8cFS8TCVuXaR1JoW+qFRh4IJvVTQ0h trYlKta6FFOQschiQZiDqNrKCVa5H4vjMssraHCLu0laHPu6ADuV1MYJqGa4gtrUYfTo A4LGpsvfTs+qCndj90vKCeTAh0zrpRUnmFWg04kc9R9Ao5miao/0U1MCcLbnR18UMvQ/ Bhxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=Yf6NwZ7pXwwv/8R1dwnZbTFrKKAchZdKJYChc9TfUZs=; b=Rf49hmfzUf49owrVWqiN+Z0AjPdd7a4ANpB9L5u6tQnP3vpqu/7VQNqFIZ1HLpov1c H6QGDmJ+GR1kDYvf6f53cZH+5Fb7iz4m9H9Xg9lZqyxiVgOkISvvZ1KhkNVsU4fSj3F2 n/HwZ0L7/jPJssHbjgo4a+x8Cts4Ix2uaXo4MrdpNPDEvdc58/FxHkKyjhvdvzO1mrsc mzb2TXS3UpZyK1PVkS6XvlYhKCKPkmDNNd1Sa+jv7BsP/qhbYjWsCgEcF9psnFrDbuM+ RWsoCDN+ryHwu0rM0EHVW4cmyYXM9SSDqEeJ8dtkrYFyg0zNHLE5o1KKkTcSVVjwmuAd 2wLQ== X-Gm-Message-State: ALoCoQlkPVhg+WdNIHjbzZ+Cx5/owi9HIgw41PML4DwoBwfaQbZD3LdzRjio1rRyhxmEBrOFOlIQ706IeasEWslmhHuRttEkjg== MIME-Version: 1.0 X-Received: by 10.107.128.104 with SMTP id b101mr541446iod.37.1452713034912; Wed, 13 Jan 2016 11:23:54 -0800 (PST) Received: by 10.79.109.138 with HTTP; Wed, 13 Jan 2016 11:23:54 -0800 (PST) In-Reply-To: <56969FF9.30402@geoffair.info> References: <20160013035742.eklhad@comcast.net> <56969FF9.30402@geoffair.info> Date: Wed, 13 Jan 2016 20:23:54 +0100 Message-ID: From: Geoff McLane To: edbrowse-dev@lists.the-brannons.com Content-Type: multipart/alternative; boundary=001a113deb7c682bf205293c1c64 Subject: Re: [Edbrowse-dev] debugging output to a file X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 19:22:57 -0000 --001a113deb7c682bf205293c1c64 Content-Type: text/plain; charset=UTF-8 My patch to get the WIN32 compile - diff --git a/src/stringfile.c b/src/stringfile.c index de96f87..ba39f66 100644 --- a/src/stringfile.c +++ b/src/stringfile.c @@ -19,7 +19,7 @@ char emptyString[] = ""; bool showHiddenFiles, isInteractive; int debugLevel = 1; -FILE *debugFile; +FILE *debugFile = 0; char *downDir, *home; /********************************************************************* @@ -642,9 +642,11 @@ void setDebugFile(const char *name) if (!name || !*name) return; debugFile = fopen(name, "w"); - if (debugFile) + if (debugFile) { +#ifndef _MSC_VER // port setlinebuf(debugFile);, required??? setlinebuf(debugFile); - else +#endif + } else printf("cannot create %s\n", name); } /* setDebugFile */ I do not know if specifically setting the debugFile to 0 is required, but otherwise there is no guarantee that it starts as a zero... and I see it tested in a lots of places, maybe before it is otherwise initialized... Regards, Geoff. --001a113deb7c682bf205293c1c64 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
My patch to get the WIN32 compi= le -

<= div class=3D"gmail_extra">diff --git a/src/stringfile.c b/src/stringfile.c<= /div>
index de96f87..ba39f66 100644
--- a/src/stringfile.c
+= ++ b/src/stringfile.c
@@ -19,7 +19,7 @@
=C2=A0char emptyString[] =3D "";
=C2=A0bool showHiddenFiles, isInteractive;
=C2=A0int debugLevel =3D 1;
-FILE *debugFile;
+FILE *debu= gFile =3D 0;
=C2=A0char *downDir, *home;
=C2=A0
=C2=A0= /*********************************************************************
@@ -642,9 +642,11 @@ void setDebugFile(const ch= ar *name)
=C2=A0 if (!name || !*name)
=C2=A0 return;
=C2=A0 = debugFile =3D fopen(name, "w");
- if (debugFile)
+ = if (debugFile) {
+#ifndef _MSC_VER // port setlinebuf(debugF= ile);, required???
=C2=A0 setlinebuf(debugFile);
- else
+#endif
+ =C2= =A0 =C2=A0} else
=C2=A0 printf("cannot create %s\n", name= );
=C2=A0} /* setDebugFile */
=C2= =A0

I do not know if specifically setting the debu= gFile to 0 is required,
but otherwise there is no guarantee that = it starts as a zero... and I=C2=A0
see it tested in a lots of pla= ces, maybe before it is otherwise=C2=A0
initialized...
=
Regards,
Geoff.

--001a113deb7c682bf205293c1c64--