X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=imap-send.c;h=16804ab286a42c0dc2733dccf816ab2173e465af;hb=151602df00b8e5c5b4a8193f59a94b85f9b5aebc;hp=6a52dbdca4f61cc1bfc288e7766e87a1425e9b3c;hpb=7cf67205ca68a157c6ffdb4e5a4ff231217c0871;p=git.git diff --git a/imap-send.c b/imap-send.c index 6a52dbdca..16804ab28 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1007,7 +1007,7 @@ imap_open_store( imap_server_conf_t *srvc ) * getpass() returns a pointer to a static buffer. make a copy * for long term storage. */ - srvc->pass = strdup( arg ); + srvc->pass = xstrdup( arg ); } if (CAP(NOLOGIN)) { fprintf( stderr, "Skipping account %s@%s, server forbids LOGIN\n", srvc->user, srvc->host ); @@ -1226,6 +1226,14 @@ split_msg( msg_data_t *all_msgs, msg_data_t *msg, int *ofs ) if (msg->len < 5 || strncmp( data, "From ", 5 )) return 0; + p = strchr( data, '\n' ); + if (p) { + p = &p[1]; + msg->len -= p-data; + *ofs += p-data; + data = p; + } + p = strstr( data, "\nFrom " ); if (p) msg->len = &p[1] - data; @@ -1263,7 +1271,7 @@ git_imap_config(const char *key, const char *val) key += sizeof imap_key - 1; if (!strcmp( "folder", key )) { - imap_folder = strdup( val ); + imap_folder = xstrdup( val ); } else if (!strcmp( "host", key )) { { if (!strncmp( "imap:", val, 5 )) @@ -1273,16 +1281,16 @@ git_imap_config(const char *key, const char *val) } if (!strncmp( "//", val, 2 )) val += 2; - server.host = strdup( val ); + server.host = xstrdup( val ); } else if (!strcmp( "user", key )) - server.user = strdup( val ); + server.user = xstrdup( val ); else if (!strcmp( "pass", key )) - server.pass = strdup( val ); + server.pass = xstrdup( val ); else if (!strcmp( "port", key )) server.port = git_config_int( key, val ); else if (!strcmp( "tunnel", key )) - server.tunnel = strdup( val ); + server.tunnel = xstrdup( val ); return 0; }