Projects STRLCPY neomutt Commits b5041f10
🤬
  • mutt: add mutt_str_upper()

    Convert all characters in a string to uppercase.
  • Loading...
  • Richard Russon committed 2 years ago
    b5041f10
    1 parent 2951598e
  • ■ ■ ■ ■ ■ ■
    mutt/string.c
    skipped 397 lines
    398 398  }
    399 399   
    400 400  /**
     401 + * mutt_str_upper - Convert all characters in the string to uppercase
     402 + * @param str String to uppercase
     403 + * @retval ptr Uppercase string
     404 + *
     405 + * The string is transformed in place.
     406 + */
     407 +char *mutt_str_upper(char *str)
     408 +{
     409 + if (!str)
     410 + return NULL;
     411 + 
     412 + char *p = str;
     413 + 
     414 + while (*p)
     415 + {
     416 + *p = toupper((unsigned char) *p);
     417 + p++;
     418 + }
     419 + 
     420 + return str;
     421 +}
     422 + 
     423 +/**
    401 424   * mutt_strn_copy - Copy a sub-string into a buffer
    402 425   * @param dest Buffer for the result
    403 426   * @param src Start of the string to copy
    skipped 642 lines
  • ■ ■ ■ ■ ■
    mutt/string2.h
    skipped 73 lines
    74 74  char * mutt_str_skip_email_wsp(const char *s);
    75 75  char * mutt_str_skip_whitespace(const char *p);
    76 76  const char *mutt_str_sysexit(int e);
     77 +char * mutt_str_upper(char *str);
    77 78   
    78 79  /* case-sensitive flavours */
    79 80  char * mutt_str_cat(char *buf, size_t buflen, const char *s);
    skipped 27 lines
Please wait...
Page is in error, reload to recover