static gboolean parse_append_filename(GString *cmd, MsgInfo *msginfo)
{
gchar *filename;
- gchar *p, *q;
- gchar escape_ch[] = "\\ ";
cm_return_val_if_fail(msginfo, FALSE);
return FALSE;
}
- p = filename;
g_string_append(cmd, "\"");
#ifdef G_OS_UNIX
+ gchar *p = filename, *q;
+ gchar escape_ch[] = "\\ ";
while ((q = strpbrk(p, "$\"`\\~")) != NULL) {
escape_ch[1] = *q;
*q = '\0';
g_io_channel_unref(source);
len = sizeof(val);
- if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &val, &len) < 0) {
+ if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)&val, &len) < 0) {
perror("getsockopt");
close(fd);
sock_connect_address_list_async(conn_data);
gint fd_gets(gint fd, gchar *buf, gint len)
{
- gchar *newline, *bp = buf;
- gint n;
+ gchar *bp = buf;
if (--len < 1)
return -1;
len--;
} while (0 < len);
#else /*!G_OS_WIN32*/
+ gchar *newline;
+ gint n;
do {
if ((n = fd_recv(fd, bp, len, MSG_PEEK)) <= 0)
return -1;
#define BUFFSIZE 8192
static gboolean debug_mode = FALSE;
-#ifdef G_OS_WIN32
-static GSList *tempfiles=NULL;
-#endif
#if !GLIB_CHECK_VERSION(2, 26, 0)
guchar *g_base64_decode_wa(const gchar *text, gsize *out_len)
(NULL, CSIDL_APPDATA|CSIDL_FLAG_CREATE,
NULL, 0, home_dir_utf16) < 0)
strcpy (home_dir_utf16, "C:\\Claws Mail");
- home_dir_utf8 = g_utf16_to_utf8 ((const gunichar *)home_dir_utf16, -1, NULL, NULL, NULL);
+ home_dir_utf8 = g_utf16_to_utf8 ((const gunichar2 *)home_dir_utf16, -1, NULL, NULL, NULL);
}
return home_dir_utf8;
#else
GSList *canonical_parts = NULL;
GStatBuf st;
int i;
+#ifndef G_OS_WIN32
gboolean follow_symlinks = TRUE;
+#endif
if (depth > 32) {
#ifndef G_OS_WIN32
if(g_stat(tmp_path, &st) < 0) {
if (errno == ENOENT) {
errno = 0;
+#ifndef G_OS_WIN32
follow_symlinks = FALSE;
+#endif
}
if (errno != 0) {
g_free(tmp_path);
/* Read data from the source into buf. */
#if defined G_OS_WIN32
if (!CryptGenRandom(rnd, count, buf)) {
- debug_print("Could not read %d random bytes.\n", count);
+ debug_print("Could not read %zd random bytes.\n", count);
CryptReleaseContext(rnd, 0);
return FALSE;
}
privacy_system_can_sign(compose->privacy_system)) {
encoding = ENC_QUOTED_PRINTABLE;
}
-
+
+#ifdef G_OS_WIN32
+ debug_print("main text: %Id bytes encoded as %s in %d\n",
+#else
debug_print("main text: %zd bytes encoded as %s in %d\n",
+#endif
strlen(buf), out_codeset, encoding);
/* check for line length limit */
}
ADDRQUERY_RETVAL(qry) = LDAPRC_STOP_FLAG;
+#ifdef G_OS_WIN32
+ debug_print("Total results are: %lu\n", ldap_count_entries(ld, result));
+#else
debug_print("Total results are: %d\n", ldap_count_entries(ld, result));
+#endif
/* Process results */
first = TRUE;
return ADDRQUERY_RETVAL(qry);
}
+#ifdef G_OS_WIN32
+ debug_print("Total results are: %lu\n", ldap_count_entries(ld, result));
+#else
debug_print("Total results are: %d\n", ldap_count_entries(ld, result));
+#endif
/* Process results */
ADDRQUERY_RETVAL(qry) = LDAPRC_STOP_FLAG;
void ldapsrv_set_options (gint secs, LDAP *ld)
{
+#ifdef G_OS_UNIX
static struct timeval timeout;
- int rc;
- int i;
timeout.tv_sec = secs;
timeout.tv_usec = 0;
-#ifdef G_OS_UNIX
+ int i, rc;
i = LDAP_OPT_X_TLS_ALLOW;
rc = ldap_set_option(NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, &i);
if (ld)
int claws_ldap_simple_bind_s( LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *passwd )
{
+ debug_print("binding: DN->%s\n", dn?dn:"null");
+#ifdef G_OS_UNIX
struct berval cred;
if ( passwd != NULL ) {
cred.bv_len = 0;
}
- debug_print("binding: DN->%s\n", dn?dn:"null");
-#ifdef G_OS_UNIX
return ldap_sasl_bind_s( ld, dn, LDAP_SASL_SIMPLE, &cred,
NULL, NULL, NULL );
#else
- return ldap_simple_bind_s(ld, dn, passwd);
+ return ldap_simple_bind_s(ld, (PCHAR)dn, (PCHAR)passwd);
#endif
}
return 0;
} else if (type == LOCK_FLOCK) {
- gboolean fcntled = FALSE;
#if HAVE_FCNTL_H && !defined(G_OS_WIN32)
+ gboolean fcntled = FALSE;
struct flock fl;
fl.l_type = F_UNLCK;
fl.l_whence = SEEK_SET;
gint child_stdin;
gchar buf[BUFFSIZE];
gboolean err = FALSE;
- gint status;
cm_return_val_if_fail(command != NULL, -1);
cm_return_val_if_fail(fp != NULL, -1);
fd_close(child_stdin);
#ifndef G_OS_WIN32
+ gint status;
waitpid(pid, &status, 0);
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
err = TRUE;
FILE *tmpfp;
gchar buf[BUFFSIZE];
CodeConverter *conv;
- const gchar *charset, *p, *cmd;
+ const gchar *charset;
+#ifndef G_OS_WIN32
+ const gchar *p, *cmd;
+#endif
GSList *cur;
gboolean continue_write = TRUE;
size_t wrote = 0, i = 0;
g_unlink(fname);
#endif
} else {
+#ifndef G_OS_WIN32
textview_default:
+#endif
if (!g_ascii_strcasecmp(mimeinfo->subtype, "x-patch")
|| !g_ascii_strcasecmp(mimeinfo->subtype, "x-diff"))
textview->is_diff = TRUE;