Write scrollback as binary on win32
Proper fix for b66edd3
This issue likely applies elsewhere in HexChat
This commit is contained in:
parent
0a29313fff
commit
ec12871e60
|
@ -176,7 +176,11 @@ scrollback_shrink (session *sess)
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
fh = g_open (file, O_CREAT | O_TRUNC | O_APPEND | O_WRONLY | _O_BINARY, 0644);
|
||||||
|
#else
|
||||||
fh = g_open (file, O_CREAT | O_TRUNC | O_APPEND | O_WRONLY, 0644);
|
fh = g_open (file, O_CREAT | O_TRUNC | O_APPEND | O_WRONLY, 0644);
|
||||||
|
#endif
|
||||||
g_free (file);
|
g_free (file);
|
||||||
if (fh == -1)
|
if (fh == -1)
|
||||||
{
|
{
|
||||||
|
@ -301,13 +305,6 @@ scrollback_load (session *sess)
|
||||||
{
|
{
|
||||||
char *buf_tmp;
|
char *buf_tmp;
|
||||||
|
|
||||||
/* If nothing but funny trailing matter e.g. 0x0d or 0x0d0a, toss it */
|
|
||||||
if (n_bytes >= 1 && buf[0] == 0x0d)
|
|
||||||
{
|
|
||||||
g_free (buf);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
n_bytes--;
|
n_bytes--;
|
||||||
buf_tmp = buf;
|
buf_tmp = buf;
|
||||||
buf = g_strndup (buf_tmp, n_bytes);
|
buf = g_strndup (buf_tmp, n_bytes);
|
||||||
|
@ -599,7 +596,7 @@ log_open_file (char *servname, char *channame, char *netname)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
fd = g_open (file, O_CREAT | O_APPEND | O_WRONLY, S_IREAD|S_IWRITE);
|
fd = g_open (file, O_CREAT | O_APPEND | O_WRONLY | _O_BINARY, S_IREAD|S_IWRITE);
|
||||||
#else
|
#else
|
||||||
fd = g_open (file, O_CREAT | O_APPEND | O_WRONLY, 0644);
|
fd = g_open (file, O_CREAT | O_APPEND | O_WRONLY, 0644);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue