projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move ascii.* into the lib-lib.
[apps/madmutt.git]
/
complete.c
diff --git
a/complete.c
b/complete.c
index
2c0f14e
..
a385af4
100644
(file)
--- a/
complete.c
+++ b/
complete.c
@@
-20,7
+20,7
@@
#include "nntp.h"
#endif
#include "nntp.h"
#endif
-#include
"lib/str.h"
+#include
<lib-lib/str.h>
#include "lib/debug.h"
#include <dirent.h>
#include "lib/debug.h"
#include <dirent.h>
@@
-60,7
+60,7
@@
int mutt_complete (char *s, size_t slen)
* special case to handle when there is no filepart yet.
* find the first subscribed newsgroup
*/
* special case to handle when there is no filepart yet.
* find the first subscribed newsgroup
*/
- if ((len = m
utt_strlen
(filepart)) == 0) {
+ if ((len = m
_strlen
(filepart)) == 0) {
for (; l; l = l->next) {
NNTP_DATA *data = (NNTP_DATA *) l->data;
for (; l; l = l->next) {
NNTP_DATA *data = (NNTP_DATA *) l->data;
@@
-77,7
+77,7
@@
int mutt_complete (char *s, size_t slen)
NNTP_DATA *data = (NNTP_DATA *) l->data;
if (data && data->subscribed &&
NNTP_DATA *data = (NNTP_DATA *) l->data;
if (data && data->subscribed &&
- s
afe_str
ncmp (data->group, filepart, len) == 0) {
+ s
tr_
ncmp (data->group, filepart, len) == 0) {
if (init) {
for (i = 0; filepart[i] && data->group[i]; i++) {
if (filepart[i] != data->group[i]) {
if (init) {
for (i = 0; filepart[i] && data->group[i]; i++) {
if (filepart[i] != data->group[i]) {
@@
-103,12
+103,8
@@
int mutt_complete (char *s, size_t slen)
#ifdef USE_IMAP
/* we can use '/' as a delimiter, imap_complete rewrites it */
if (*s == '=' || *s == '+' || *s == '!') {
#ifdef USE_IMAP
/* we can use '/' as a delimiter, imap_complete rewrites it */
if (*s == '=' || *s == '+' || *s == '!') {
- if (*s == '!')
- p = NONULL (Spoolfile);
- else
- p = NONULL (Maildir);
-
- mutt_concat_path (imap_path, p, s + 1, sizeof (imap_path));
+ const char *q = NONULL(*s == '!' ? Spoolfile : Maildir);
+ mutt_concat_path (imap_path, q, s + 1, sizeof (imap_path));
}
else
strfcpy (imap_path, s, sizeof (imap_path));
}
else
strfcpy (imap_path, s, sizeof (imap_path));
@@
-176,10
+172,10
@@
int mutt_complete (char *s, size_t slen)
* special case to handle when there is no filepart yet. find the first
* file/directory which is not ``.'' or ``..''
*/
* special case to handle when there is no filepart yet. find the first
* file/directory which is not ``.'' or ``..''
*/
- if ((len = m
utt_strlen
(filepart)) == 0) {
+ if ((len = m
_strlen
(filepart)) == 0) {
while ((de = readdir (dirp)) != NULL) {
while ((de = readdir (dirp)) != NULL) {
- if (
mutt_str
cmp (".", de->d_name) != 0
- &&
mutt_str
cmp ("..", de->d_name) != 0) {
+ if (
str_
cmp (".", de->d_name) != 0
+ &&
str_
cmp ("..", de->d_name) != 0) {
strfcpy (filepart, de->d_name, sizeof (filepart));
init++;
break;
strfcpy (filepart, de->d_name, sizeof (filepart));
init++;
break;
@@
-188,7
+184,7
@@
int mutt_complete (char *s, size_t slen)
}
while ((de = readdir (dirp)) != NULL) {
}
while ((de = readdir (dirp)) != NULL) {
- if (s
afe_str
ncmp (de->d_name, filepart, len) == 0) {
+ if (s
tr_
ncmp (de->d_name, filepart, len) == 0) {
if (init) {
for (i = 0; filepart[i] && de->d_name[i]; i++) {
if (filepart[i] != de->d_name[i]) {
if (init) {
for (i = 0; filepart[i] && de->d_name[i]; i++) {
if (filepart[i] != de->d_name[i]) {
@@
-207,14
+203,14
@@
int mutt_complete (char *s, size_t slen)
/* check to see if it is a directory */
if (dirpart[0]) {
strfcpy (buf, exp_dirpart, sizeof (buf));
/* check to see if it is a directory */
if (dirpart[0]) {
strfcpy (buf, exp_dirpart, sizeof (buf));
- strfcpy (buf + m
utt_strlen (buf), "/", sizeof (buf) - mutt_strlen
(buf));
+ strfcpy (buf + m
_strlen(buf), "/", sizeof (buf) - m_strlen
(buf));
}
else
buf[0] = 0;
}
else
buf[0] = 0;
- strfcpy (buf + m
utt_strlen (buf), filepart, sizeof (buf) - mutt_strlen
(buf));
+ strfcpy (buf + m
_strlen(buf), filepart, sizeof (buf) - m_strlen
(buf));
if (stat (buf, &st) != -1 && (st.st_mode & S_IFDIR))
if (stat (buf, &st) != -1 && (st.st_mode & S_IFDIR))
- strfcpy (filepart + m
utt_strlen
(filepart), "/",
- sizeof (filepart) - m
utt_strlen
(filepart));
+ strfcpy (filepart + m
_strlen
(filepart), "/",
+ sizeof (filepart) - m
_strlen
(filepart));
init = 1;
}
}
init = 1;
}
}
@@
-223,10
+219,10
@@
int mutt_complete (char *s, size_t slen)
if (dirpart[0]) {
strfcpy (s, dirpart, slen);
if (dirpart[0]) {
strfcpy (s, dirpart, slen);
- if (
mutt_str
cmp ("/", dirpart) != 0 && dirpart[0] != '='
+ if (
str_
cmp ("/", dirpart) != 0 && dirpart[0] != '='
&& dirpart[0] != '+')
&& dirpart[0] != '+')
- strfcpy (s + m
utt_strlen (s), "/", slen - mutt_strlen
(s));
- strfcpy (s + m
utt_strlen (s), filepart, slen - mutt_strlen
(s));
+ strfcpy (s + m
_strlen(s), "/", slen - m_strlen
(s));
+ strfcpy (s + m
_strlen(s), filepart, slen - m_strlen
(s));
}
else
strfcpy (s, filepart, slen);
}
else
strfcpy (s, filepart, slen);