Re: [PATCH v10 6/9] imap-send: fix numerous spelling and grammar mistakes in logs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jun 1, 2025 at 3:12 AM Aditya Garg <gargaditya08@xxxxxxxx> wrote:
> A lot of spelling and grammar mistakes were found in the logs shown to
> the user while using imap-send. Most of them are lack of a full stop at
> the end of a sentence and first word of a sentence not being capitalized.
>
> Signed-off-by: Aditya Garg <gargaditya08@xxxxxxxx>
> ---
> diff --git a/imap-send.c b/imap-send.c
> @@ -249,9 +249,9 @@ static int verify_hostname(X509 *cert, const char *hostname)
>         if (!(subj = X509_get_subject_name(cert)))
> -               return error("cannot get certificate subject");
> +               return error("Cannot get certificate subject");
>         if ((len = X509_NAME_get_text_by_NID(subj, NID_commonName, cname, sizeof(cname))) < 0)
> -               return error("cannot get certificate common name");
> +               return error("Cannot get certificate common name");

This patch generally seems to be taking the code in a direction
opposite the rest of the project. Quoting from
Documentation/CodingGuidelines:

  Error Messages

   - Do not end a single-sentence error message with a full stop.

   - Do not capitalize the first word, only because it is the first
     word in the message ("unable to open '%s'", not "Unable to open
     '%s'"). But "SHA-3 not supported" is fine, because the reason the
     first word is capitalized is not because it is at the beginning
     of the sentence, but because the word would be spelled in capital
     letters even when it appeared in the middle of the sentence.

> @@ -1053,7 +1053,7 @@ static int auth_cram_md5(struct imap_store *ctx, const char *prompt)
>         if (ret != strlen(response)) {
>                 free(response);
> -               return error("IMAP error: sending response failed");
> +               return error("IMAP error: sending CRAM-MD5 response failed");
>         }

Providing more context in the error message, as done here, seems welcome.

> @@ -1223,7 +1223,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
> -                       fputs("Error: unable to connect to server.\n", stderr);
> +                       fputs("Error: unable to connect to server\n", stderr);
> @@ -1343,13 +1343,13 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
> -                               fprintf(stderr, "Skipping account %s@%s, server forbids LOGIN\n",
> +                               fprintf(stderr, "Skipping account %s@%s, server forbids LOGIN.\n",
> @@ -1594,12 +1594,12 @@ static int append_msgs_to_imap(struct imap_server_conf *server,
> -               fprintf(stderr, "failed to open store\n");
> +               fprintf(stderr, "Failed to open store.\n");

Taking the above guidelines into account, these probably ought to be
changed to start with lowercase.





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux