Commit 3368047b 3368047b4fe0fd96311c1e74d76d08c71d429959 by Alain Magloire

Remove more GPL dependencies.

1 parent ba0fcf20
......@@ -2,11 +2,17 @@
GNU md5 is GPL, but we agreed that the libraries should
fall under LGPL.
Same goes for basename() and pretty much everything under
lib/*.[ch]
* mailbox/message.c (message_get_uidl): Remove the dependency
from GNU md5.
* mailbox/md5-rsa.c: New File.
* mailbox/md5-rsa.h: New File.
* mailbox/attachment.c (message_create_attachment): Remove
the dependency from lib/basename.c
* mailbox/mbx_mbox.c (mbox_tempfile): Remove
the dependency from lib/basename.c
* lib/signame.c: Replace in favor of the wellknown strsignal().
* lib/strsignal.c: New file, use the mu_signame() written by
......
......@@ -47,7 +47,6 @@
/* FIXME: this should be in a public header. */
extern int message_attachment_filename __P ((message_t, const char **filename));
extern char *base_name __P ((char const *));
struct _msg_info {
char *buf;
......@@ -82,7 +81,11 @@ int message_create_attachment(const char *content_type, const char *encoding, co
if ( encoding == NULL )
encoding = "7bit";
if ( ( fname = strdup(filename) ) != NULL ) {
name = base_name(fname);
name = strrchr (fname, '/');
if (name)
name++;
else
name = fname;
if ( ( header = alloca(strlen(MSG_HDR) + strlen(content_type) + strlen(name) * 2 + strlen(encoding) + 1) ) == NULL )
ret = ENOMEM;
else {
......@@ -109,7 +112,7 @@ int message_create_attachment(const char *content_type, const char *encoding, co
if ( fstream )
stream_destroy(&fstream, NULL);
if ( fname )
free(fname);
free(fname);
}
return ret;
}
......
......@@ -161,8 +161,6 @@ struct _mbox_data
mailbox_t mailbox; /* Back pointer. */
};
extern char *base_name __P ((char const *));
/* Mailbox concrete implementation. */
static int mbox_open __P ((mailbox_t, int));
static int mbox_close __P ((mailbox_t));
......@@ -504,7 +502,11 @@ mbox_tmpfile (mailbox_t mailbox, char **pbox)
# define P_tmpdir "/tmp"
#endif
basename = base_name (mud->name);
basename = strrchr (mud->name, '/');
if (basename)
basename++;
else
basename = mud->name;
tmpdir = getenv ("TMPDIR") ? getenv ("TMPDIR") : P_tmpdir;
/* (separator + null) == 2 + XXXXXX == 6 + ... */
......