X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=ident.c;h=dbd0f527b27e1fd4139862a452d901d851367fb0;hb=f64c81d4282b1dacf2cf095bfb0f7708b99b3ecf;hp=6612d17eba1b2bac59689d4fd5e742df242662fc;hpb=b9dcf846e20ed5287e239c9a0942c5d150081bab;p=git.git diff --git a/ident.c b/ident.c index 6612d17eb..dbd0f527b 100644 --- a/ident.c +++ b/ident.c @@ -113,25 +113,15 @@ static int add_raw(char *buf, size_t size, int offset, const char *str) static int crud(unsigned char c) { - static char crud_array[256]; - static int crud_array_initialized = 0; - - if (!crud_array_initialized) { - int k; - - for (k = 0; k <= 31; ++k) crud_array[k] = 1; - crud_array[' '] = 1; - crud_array['.'] = 1; - crud_array[','] = 1; - crud_array[':'] = 1; - crud_array[';'] = 1; - crud_array['<'] = 1; - crud_array['>'] = 1; - crud_array['"'] = 1; - crud_array['\''] = 1; - crud_array_initialized = 1; - } - return crud_array[c]; + return c <= 32 || + c == '.' || + c == ',' || + c == ':' || + c == ';' || + c == '<' || + c == '>' || + c == '"' || + c == '\''; } /* @@ -185,11 +175,11 @@ static const char *env_hint = "\n" "Run\n" "\n" -" git config user.email \"you@email.com\"\n" -" git config user.name \"Your Name\"\n" +" git config --global user.email \"you@email.com\"\n" +" git config --global user.name \"Your Name\"\n" "\n" -"To set the identity in this repository.\n" -"Add --global to set your account\'s default\n" +"to set your account\'s default identity.\n" +"Omit --global to set the identity only in this repository.\n" "\n"; const char *fmt_ident(const char *name, const char *email,