From: Geoff McLane <ubuntu@geoffair.info>
To: edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] debugging output to a file
Date: Wed, 13 Jan 2016 20:23:54 +0100 [thread overview]
Message-ID: <CA+PgotKpV0g5AALeosUtSwg=pacyPszzpzAO2OzWaT89+fCb5A@mail.gmail.com> (raw)
In-Reply-To: <56969FF9.30402@geoffair.info>
[-- Attachment #1: Type: text/plain, Size: 971 bytes --]
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.
[-- Attachment #2: Type: text/html, Size: 2520 bytes --]
next prev parent reply other threads:[~2016-01-13 19:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-13 8:57 Karl Dahlke
2016-01-13 19:05 ` Geoff McLane
2016-01-13 19:23 ` Geoff McLane [this message]
2016-01-16 14:46 ` Adam Thompson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+PgotKpV0g5AALeosUtSwg=pacyPszzpzAO2OzWaT89+fCb5A@mail.gmail.com' \
--to=ubuntu@geoffair.info \
--cc=edbrowse-dev@lists.the-brannons.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).