]> granicus.if.org Git - neomutt/commitdiff
drop unnecessary NONULL
authorRichard Russon <rich@flatcap.org>
Sat, 4 Aug 2018 19:04:24 +0000 (20:04 +0100)
committerRichard Russon <rich@flatcap.org>
Sat, 4 Aug 2018 22:20:21 +0000 (23:20 +0100)
24 files changed:
alias.c
browser.c
color.c
commands.c
complete.c
compose.c
edit.c
hdrline.c
hook.c
imap/browse.c
imap/imap.c
main.c
mutt/file.c
mutt_account.c
muttlib.c
mx.c
ncrypt/crypt_gpgme.c
ncrypt/pgpkey.c
ncrypt/smime.c
nntp/nntp.c
pattern.c
pop/pop.c
rfc1524.c
send.c

diff --git a/alias.c b/alias.c
index d414584ddc8a982197a42a747a88c2bb08f8609b..91e29980f1438310b5189ad82098e1bbb1dafe69 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -462,7 +462,7 @@ retry_name:
 
   TAILQ_INSERT_TAIL(&Aliases, new, entries);
 
-  mutt_str_strfcpy(buf, NONULL(AliasFile), sizeof(buf));
+  mutt_str_strfcpy(buf, AliasFile, sizeof(buf));
   if (mutt_get_field(_("Save to file: "), buf, sizeof(buf), MUTT_FILE) != 0)
     return;
   mutt_expand_path(buf, sizeof(buf));
index ca936f486047367349e8b425c8bb575d47a897f8..a424f5d3b6d35da1a1b39e4dcc82ce3e849c4439 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -1456,7 +1456,7 @@ void mutt_select_file(char *file, size_t filelen, int flags, char ***files, int
             case MUTT_MH:
             case MUTT_MMDF:
               if (Folder)
-                mutt_str_strfcpy(LastDir, NONULL(Folder), sizeof(LastDir));
+                mutt_str_strfcpy(LastDir, Folder, sizeof(LastDir));
               else if (Spoolfile)
                 mutt_browser_select_dir(Spoolfile);
               break;
@@ -1671,7 +1671,7 @@ void mutt_select_file(char *file, size_t filelen, int flags, char ***files, int
                 mutt_str_strfcpy(LastDir, OldLastDir, sizeof(LastDir));
                 if (examine_directory(menu, &state, LastDir, prefix) == -1)
                 {
-                  mutt_str_strfcpy(LastDir, NONULL(HomeDir), sizeof(LastDir));
+                  mutt_str_strfcpy(LastDir, HomeDir, sizeof(LastDir));
                   goto bail;
                 }
               }
@@ -1940,7 +1940,7 @@ void mutt_select_file(char *file, size_t filelen, int flags, char ***files, int
 
       case OP_ENTER_MASK:
       {
-        mutt_str_strfcpy(buf, NONULL(Mask ? Mask->pattern : NULL), sizeof(buf));
+        mutt_str_strfcpy(buf, Mask ? Mask->pattern : NULL, sizeof(buf));
         if (mutt_get_field(_("File Mask: "), buf, sizeof(buf), 0) != 0)
           break;
 
diff --git a/color.c b/color.c
index 690fef5ce2fea5b232f2d4c345f4d7b55f328490..d497589de6ab83601428ef4b154cd5f256a37467 100644 (file)
--- a/color.c
+++ b/color.c
@@ -755,7 +755,7 @@ static int add_pattern(struct ColorLineHead *top, const char *s, bool sensitive,
     if (is_index)
     {
       char buf[LONG_STRING];
-      mutt_str_strfcpy(buf, NONULL(s), sizeof(buf));
+      mutt_str_strfcpy(buf, s, sizeof(buf));
       mutt_check_simple(buf, sizeof(buf), NONULL(SimpleSearch));
       tmp->color_pattern = mutt_pattern_comp(buf, MUTT_FULL_MSG, err);
       if (!tmp->color_pattern)
index 281f8a3b20d203e5b7b6a54746c366959af18378..579d1b59556fa31f7120be35acd15dd0adf47e3c 100644 (file)
@@ -1092,7 +1092,7 @@ int mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp)
   short structure_changed = 0;
 
   char *cp = mutt_param_get(&b->parameter, "charset");
-  mutt_str_strfcpy(charset, NONULL(cp), sizeof(charset));
+  mutt_str_strfcpy(charset, cp, sizeof(charset));
 
   snprintf(buf, sizeof(buf), "%s/%s", TYPE(b), b->subtype);
   mutt_str_strfcpy(obuf, buf, sizeof(obuf));
index 484056e73067cce911977b8ba8feb76881d701ca..19b8b45eef47cc4abbb2faf644bcef8f3afc677c 100644 (file)
@@ -151,9 +151,9 @@ int mutt_complete(char *buf, size_t buflen)
     dirpart[0] = *buf;
     dirpart[1] = '\0';
     if (*buf == '!')
-      mutt_str_strfcpy(exp_dirpart, NONULL(Spoolfile), sizeof(exp_dirpart));
+      mutt_str_strfcpy(exp_dirpart, Spoolfile, sizeof(exp_dirpart));
     else
-      mutt_str_strfcpy(exp_dirpart, NONULL(Folder), sizeof(exp_dirpart));
+      mutt_str_strfcpy(exp_dirpart, Folder, sizeof(exp_dirpart));
     p = strrchr(buf, '/');
     if (p)
     {
index 46c7b9cad383b908f501d5a2fbde8d0656003dc4..07f12345aeddfae16b1a291995c001329f9c9479 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -1426,7 +1426,7 @@ int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen,
           if ((op == OP_COMPOSE_ATTACH_MESSAGE) ^ (Context->magic == MUTT_NNTP))
 #endif
           {
-            mutt_str_strfcpy(fname, NONULL(Context->path), sizeof(fname));
+            mutt_str_strfcpy(fname, Context->path, sizeof(fname));
             mutt_pretty_mailbox(fname, sizeof(fname));
           }
 
@@ -1924,7 +1924,7 @@ int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen,
         fname[0] = '\0';
         if (Context)
         {
-          mutt_str_strfcpy(fname, NONULL(Context->path), sizeof(fname));
+          mutt_str_strfcpy(fname, Context->path, sizeof(fname));
           mutt_pretty_mailbox(fname, sizeof(fname));
         }
         if (actx->idxlen)
diff --git a/edit.c b/edit.c
index 5a9b64aaa6cf9b183efa899db6d6d329be097b5e..5635774c670158a37dfbef42ea5a558d8b908910 100644 (file)
--- a/edit.c
+++ b/edit.c
@@ -92,7 +92,7 @@ static char **be_snarf_data(FILE *f, char **buf, int *bufmax, int *buflen,
   tmp[sizeof(tmp) - 1] = '\0';
   if (prefix)
   {
-    mutt_str_strfcpy(tmp, NONULL(IndentString), sizeof(tmp));
+    mutt_str_strfcpy(tmp, IndentString, sizeof(tmp));
     tmplen = mutt_str_strlen(tmp);
     p = tmp + tmplen;
     tmplen = sizeof(tmp) - tmplen;
index 02001b7608718f588fa31a1a74eaae4da4c49b12..976cfc520299add9137f055637929171d54d82cc 100644 (file)
--- a/hdrline.c
+++ b/hdrline.c
@@ -1073,7 +1073,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
       break;
 
     case 'P':
-      mutt_str_strfcpy(buf, NONULL(hfi->pager_progress), buflen);
+      mutt_str_strfcpy(buf, hfi->pager_progress, buflen);
       break;
 
 #ifdef USE_NNTP
diff --git a/hook.c b/hook.c
index 9d686062818ffe0147ceaf60c2c39f3ab1ea58e8..59bea84e15908aeb7786c47155a46d0387eed559 100644 (file)
--- a/hook.c
+++ b/hook.c
@@ -575,10 +575,10 @@ void mutt_select_fcc(char *path, size_t pathlen, struct Header *hdr)
       mutt_safe_path(buf, sizeof(buf), addr);
       mutt_file_concat_path(path, NONULL(Folder), buf, pathlen);
       if (!ForceName && mx_access(path, W_OK) != 0)
-        mutt_str_strfcpy(path, NONULL(Record), pathlen);
+        mutt_str_strfcpy(path, Record, pathlen);
     }
     else
-      mutt_str_strfcpy(path, NONULL(Record), pathlen);
+      mutt_str_strfcpy(path, Record, pathlen);
   }
   mutt_pretty_mailbox(path, pathlen);
 }
index 79d5d083740e363ca01d562586614eceea8f903a..188882139f0cea66c53363870473a381fa6d242e 100644 (file)
@@ -385,7 +385,7 @@ int imap_mailbox_create(const char *folder)
     goto fail;
   }
 
-  mutt_str_strfcpy(buf, NONULL(mx.mbox), sizeof(buf));
+  mutt_str_strfcpy(buf, mx.mbox, sizeof(buf));
 
   /* append a delimiter if necessary */
   n = mutt_str_strlen(buf);
index 3611ba40e1088927e18c5aa7807a9befb183b5fa..2c7563ce4644ba7bf67e30398cb33c1f583bb12a 100644 (file)
@@ -1814,7 +1814,7 @@ int imap_complete(char *buf, size_t buflen, char *path)
   imap_cmd_start(idata, tmp);
 
   /* and see what the results are */
-  mutt_str_strfcpy(completion, NONULL(mx.mbox), sizeof(completion));
+  mutt_str_strfcpy(completion, mx.mbox, sizeof(completion));
   idata->cmdtype = IMAP_CT_LIST;
   idata->cmddata = &listresp;
   do
diff --git a/main.c b/main.c
index 38cda045f23764770a5051677cdb78c3bc5d0422..1a8186303fdf9ac6877f78d0e44a4ab928faf168 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1156,9 +1156,9 @@ int main(int argc, char *argv[], char *envp[])
     if (!folder[0])
     {
       if (Spoolfile)
-        mutt_str_strfcpy(folder, NONULL(Spoolfile), sizeof(folder));
+        mutt_str_strfcpy(folder, Spoolfile, sizeof(folder));
       else if (Folder)
-        mutt_str_strfcpy(folder, NONULL(Folder), sizeof(folder));
+        mutt_str_strfcpy(folder, Folder, sizeof(folder));
       /* else no folder */
     }
 
index 62309fc035f7778e92ba95d2a31a35b299b9b482..be24c8be698e1e86551a3c07714ec9376e87aeae 100644 (file)
@@ -93,7 +93,7 @@ static int mkwrapdir(const char *path, char *newfile, size_t nflen, char *newdir
   char parent[PATH_MAX];
   char *p = NULL;
 
-  mutt_str_strfcpy(parent, NONULL(path), sizeof(parent));
+  mutt_str_strfcpy(parent, path, sizeof(parent));
 
   p = strrchr(parent, '/');
   if (p)
index 49afb6f28c3c8ae7a94295b8db6eba9b7ff50f87..fac54c05468413566cfe23dbbe3bfa4ab6f55233 100644 (file)
@@ -228,7 +228,7 @@ int mutt_account_getuser(struct Account *account)
   {
     /* L10N: Example: Username at myhost.com */
     snprintf(prompt, sizeof(prompt), _("Username at %s: "), account->host);
-    mutt_str_strfcpy(account->user, NONULL(Username), sizeof(account->user));
+    mutt_str_strfcpy(account->user, Username, sizeof(account->user));
     if (mutt_get_field_unbuffered(prompt, account->user, sizeof(account->user), 0))
       return -1;
   }
index 520c386605486c46e9991a57e581231e3848a3b2..793cdbc235969767fdae4359d84100278e700776 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -149,7 +149,7 @@ char *mutt_expand_path_regex(char *buf, size_t buflen, bool regex)
       {
         if (*(buf + 1) == '/' || *(buf + 1) == 0)
         {
-          mutt_str_strfcpy(p, NONULL(HomeDir), sizeof(p));
+          mutt_str_strfcpy(p, HomeDir, sizeof(p));
           tail = buf + 1;
         }
         else
@@ -188,20 +188,20 @@ char *mutt_expand_path_regex(char *buf, size_t buflen, bool regex)
       {
 #ifdef USE_IMAP
         /* if folder = {host} or imap[s]://host/: don't append slash */
-        if (mx_is_imap(NONULL(Folder)) &&
+        if (mx_is_imap(Folder) &&
             (Folder[strlen(Folder) - 1] == '}' || Folder[strlen(Folder) - 1] == '/'))
         {
-          mutt_str_strfcpy(p, NONULL(Folder), sizeof(p));
+          mutt_str_strfcpy(p, Folder, sizeof(p));
         }
         else
 #endif
 #ifdef USE_NOTMUCH
-            if (mx_is_notmuch(NONULL(Folder)))
-          mutt_str_strfcpy(p, NONULL(Folder), sizeof(p));
+            if (mx_is_notmuch(Folder))
+          mutt_str_strfcpy(p, Folder, sizeof(p));
         else
 #endif
             if (Folder && *Folder && Folder[strlen(Folder) - 1] == '/')
-          mutt_str_strfcpy(p, NONULL(Folder), sizeof(p));
+          mutt_str_strfcpy(p, Folder, sizeof(p));
         else
           snprintf(p, sizeof(p), "%s/", NONULL(Folder));
 
@@ -233,14 +233,14 @@ char *mutt_expand_path_regex(char *buf, size_t buflen, bool regex)
 
       case '>':
       {
-        mutt_str_strfcpy(p, NONULL(Mbox), sizeof(p));
+        mutt_str_strfcpy(p, Mbox, sizeof(p));
         tail = buf + 1;
       }
       break;
 
       case '<':
       {
-        mutt_str_strfcpy(p, NONULL(Record), sizeof(p));
+        mutt_str_strfcpy(p, Record, sizeof(p));
         tail = buf + 1;
       }
       break;
@@ -249,12 +249,12 @@ char *mutt_expand_path_regex(char *buf, size_t buflen, bool regex)
       {
         if (*(buf + 1) == '!')
         {
-          mutt_str_strfcpy(p, NONULL(LastFolder), sizeof(p));
+          mutt_str_strfcpy(p, LastFolder, sizeof(p));
           tail = buf + 2;
         }
         else
         {
-          mutt_str_strfcpy(p, NONULL(Spoolfile), sizeof(p));
+          mutt_str_strfcpy(p, Spoolfile, sizeof(p));
           tail = buf + 1;
         }
       }
@@ -262,14 +262,14 @@ char *mutt_expand_path_regex(char *buf, size_t buflen, bool regex)
 
       case '-':
       {
-        mutt_str_strfcpy(p, NONULL(LastFolder), sizeof(p));
+        mutt_str_strfcpy(p, LastFolder, sizeof(p));
         tail = buf + 1;
       }
       break;
 
       case '^':
       {
-        mutt_str_strfcpy(p, NONULL(CurrentFolder), sizeof(p));
+        mutt_str_strfcpy(p, CurrentFolder, sizeof(p));
         tail = buf + 1;
       }
       break;
@@ -1523,7 +1523,7 @@ void mutt_encode_path(char *buf, size_t buflen, const char *src)
   char *p = mutt_str_strdup(src);
   int rc = mutt_ch_convert_string(&p, Charset, "us-ascii", 0);
   /* `src' may be NULL, such as when called from the pop3 driver. */
-  size_t len = mutt_str_strfcpy(buf, (rc == 0) ? NONULL(p) : NONULL(src), buflen);
+  size_t len = mutt_str_strfcpy(buf, (rc == 0) ? p : src, buflen);
 
   /* convert the path to POSIX "Portable Filename Character Set" */
   for (size_t i = 0; i < len; ++i)
@@ -1593,7 +1593,7 @@ void mutt_get_parent_path(char *path, char *buf, size_t buflen)
 #endif
 #ifdef USE_NOTMUCH
       if (mx_is_notmuch(path))
-    mutt_str_strfcpy(buf, NONULL(Folder), buflen);
+    mutt_str_strfcpy(buf, Folder, buflen);
   else
 #endif
   {
diff --git a/mx.c b/mx.c
index ecd33f15f6a799b64b7f314a4a428aa9e5e2b51c..044fab62d2e1d64737ecae3a306ae73838f3027a 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -748,7 +748,7 @@ int mx_mbox_close(struct Context *ctx, int *index_hint)
     }
     else
     {
-      mutt_str_strfcpy(mbox, NONULL(Mbox), sizeof(mbox));
+      mutt_str_strfcpy(mbox, Mbox, sizeof(mbox));
       is_spool = mutt_is_spool(ctx->path) && !mutt_is_spool(mbox);
     }
 
index 3190193584e3905e5777667ef155c0c730d721d4..d0348d1f7062e1377fa374a9c57e0a751492ebdb 100644 (file)
@@ -4727,7 +4727,7 @@ static struct CryptKeyInfo *crypt_ask_for_key(char *tag, char *whatfor, short ab
     {
       if (mutt_str_strcasecmp(whatfor, l->what) == 0)
       {
-        mutt_str_strfcpy(resp, NONULL(l->dflt), sizeof(resp));
+        mutt_str_strfcpy(resp, l->dflt, sizeof(resp));
         break;
       }
     }
index 3db5172190bd733b3df99fe510489e23a62e0074..976c2d0d9e568f3136a96853c7acdb665934f8a2 100644 (file)
@@ -840,7 +840,7 @@ struct PgpKeyInfo *pgp_ask_for_key(char *tag, char *whatfor, short abilities, en
     {
       if (mutt_str_strcasecmp(whatfor, l->what) == 0)
       {
-        mutt_str_strfcpy(resp, NONULL(l->dflt), sizeof(resp));
+        mutt_str_strfcpy(resp, l->dflt, sizeof(resp));
         break;
       }
     }
index a96c48dd1e2451995f5d5737917051f76bc17439..e58c5b9b369115e46a7ebe2bed7e0547a7c31411 100644 (file)
@@ -239,7 +239,7 @@ static const char *fmt_smime_command(char *buf, size_t buflen, size_t col, int c
         char buf1[LONG_STRING], buf2[LONG_STRING];
         struct stat sb;
 
-        mutt_str_strfcpy(path, NONULL(SmimeCaLocation), sizeof(path));
+        mutt_str_strfcpy(path, SmimeCaLocation, sizeof(path));
         mutt_expand_path(path, sizeof(path));
         mutt_file_quote_filename(buf1, sizeof(buf1), path);
 
index d52f90015e3c1b40dd0cd789475c0b8b0a9c4b3c..0fb79a005b66ef5945c7515e4c6b6fca8b482cd6 100644 (file)
@@ -368,7 +368,7 @@ static int nntp_auth(struct NntpServer *nserv)
       mutt_str_strfcpy(authenticators, NntpAuthenticators, sizeof(authenticators));
     else if (nserv->hasCAPABILITIES)
     {
-      mutt_str_strfcpy(authenticators, NONULL(nserv->authenticators), sizeof(authenticators));
+      mutt_str_strfcpy(authenticators, nserv->authenticators, sizeof(authenticators));
       p = authenticators;
       while (*p)
       {
index 90ac3a584ec17143991803d78341898cd17e2c86..7265e939a16ade470a0b383c4d6a73794d1871e3 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -2211,7 +2211,7 @@ int mutt_pattern_func(int op, char *prompt)
   int rc = -1;
   struct Progress progress;
 
-  mutt_str_strfcpy(buf, NONULL(Context->pattern), sizeof(buf));
+  mutt_str_strfcpy(buf, Context->pattern, sizeof(buf));
   if (prompt || op != MUTT_LIMIT)
     if (mutt_get_field(prompt, buf, sizeof(buf), MUTT_PATTERN | MUTT_CLEAR) != 0 || !buf[0])
       return -1;
index 496c3cb0b4cfe6c1260e2d4244b16ceb6fdd1365..d2dd1cd1e4e407ff474e94d5a50ddd7ad3faa00a 100644 (file)
--- a/pop/pop.c
+++ b/pop/pop.c
@@ -977,7 +977,7 @@ void pop_fetch_mail(void)
     goto finish;
   }
 
-  if (mx_mbox_open(NONULL(Spoolfile), MUTT_APPEND, &ctx) == NULL)
+  if (mx_mbox_open(Spoolfile, MUTT_APPEND, &ctx) == NULL)
     goto finish;
 
   delanswer = query_quadoption(PopDelete, _("Delete messages from server?"));
index d65e8fe7cb0efb0682cc0200412b0db92b03bace..b4d28d897813b919d1f978028fb6e465ed446704 100644 (file)
--- a/rfc1524.c
+++ b/rfc1524.c
@@ -104,7 +104,7 @@ int rfc1524_expand_command(struct Body *a, char *filename, char *type, char *com
         param[z] = '\0';
 
         pvalue2 = mutt_param_get(&a->parameter, param);
-        mutt_str_strfcpy(pvalue, NONULL(pvalue2), sizeof(pvalue));
+        mutt_str_strfcpy(pvalue, pvalue2, sizeof(pvalue));
         if (MailcapSanitize)
           mutt_file_sanitize_filename(pvalue, false);
 
diff --git a/send.c b/send.c
index 9dfdfbd80f89fd0e65502898c55a0570f4ed2f95..36abcb74587bee9a305a51967d40a1edc385b4fe 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1255,7 +1255,7 @@ struct Address *mutt_default_from(void)
     }
     else
     {
-      addr->mailbox = mutt_str_strdup(NONULL(Username));
+      addr->mailbox = mutt_str_strdup(Username);
     }
   }
 
@@ -1894,7 +1894,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
           (mutt_str_strcasecmp("plain", msg->content->subtype) == 0))
       {
         char *p = mutt_param_get(&msg->content->parameter, "format");
-        if (mutt_str_strcasecmp("flowed", NONULL(p)) != 0)
+        if (mutt_str_strcasecmp("flowed", p) != 0)
           rfc3676_space_stuff(msg);
       }