# include "config.h"
#endif
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <errno.h>
+#include <unistd.h>
+
#include <lib-lib/mem.h>
#include <lib-lib/str.h>
#include <lib-lib/ascii.h>
#include <lib-lib/macros.h>
#include <lib-lib/file.h>
+#include <lib-lib/debug.h>
+
+#include <lib-sys/unix.h>
#include "mutt.h"
#include "rfc1524.h"
#include "attach.h"
-#include "lib/debug.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <errno.h>
-#include <unistd.h>
-
/* The command semantics include the following:
* %s is the filename that contains the mail body data
* %t is the content type, like text/plain
if (option (OPTMAILCAPSANITIZE))
mutt_sanitize_filename (type, 0);
- while (command[x] && x < clen && y < sizeof (buf)) {
+ while (command[x] && x < clen && y < ssizeof (buf)) {
if (command[x] == '\\') {
x++;
buf[y++] = command[x++];
int z = 0;
x++;
- while (command[x] && command[x] != '}' && z < sizeof (param))
+ while (command[x] && command[x] != '}' && z < ssizeof (param))
param[z++] = command[x++];
param[z] = '\0';
break;
}
}
- str_skip_trailws (s);
+ m_strrtrim(s);
return ch;
}
if (*field == '=') {
if (entry) {
field = vskipspaces(field + 1);
- str_replace (entry, field);
+ m_strreplace(entry, field);
}
return 1;
}
{
FILE *fp;
char *buf = NULL;
- size_t buflen;
+ ssize_t buflen;
char *ch;
char *field;
int found = FALSE;
btlen = ch - type;
if ((fp = fopen (filename, "r")) != NULL) {
- while (!found && (buf = mutt_read_line (buf, &buflen, fp, &line)) != NULL) {
+ while (!found && (buf = mutt_read_line(buf, &buflen, fp, &line)) != NULL) {
/* ignore comments */
if (*buf == '#')
continue;
* if this is the right entry.
*/
char *test_command = NULL;
- size_t len;
+ ssize_t len;
if (get_field_text (field + 4, &test_command, type, filename, line)
&& test_command) {
while (!found && *curr) {
x = 0;
- while (*curr && *curr != ':' && x < sizeof (path) - 1) {
+ while (*curr && *curr != ':' && x < ssizeof (path) - 1) {
path[x++] = *curr;
curr++;
}
* Returns 1 if newfile specified
*/
-static void strnfcpy (char *d, char *s, size_t siz, size_t len)
-{
- if (len > siz)
- len = siz - 1;
- m_strcpy(d, len, s);
-}
-
int rfc1524_expand_filename (char *nametemplate,
- char *oldfile, char *newfile, size_t nflen)
+ char *oldfile, char *newfile, ssize_t nflen)
{
int i, j, k, ps, r;
char *s;
if (lmatch)
*left = 0;
else
- strnfcpy (left, nametemplate, sizeof (left), i);
+ m_strncpy(left, sizeof(left), nametemplate, i);
if (rmatch)
*right = 0;