git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v4] grep: fix multibyte regex handling under macOS

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 13, 2022, 17:32 UTC
Message-ID
<xmqqzgf389k9.fsf@gitster.g>
In-Reply-To
<20220826085815.2771102-1-dds@aueb.gr>
Diomidis Spinellis <dds@aueb.gr> writes:
> - Fold test script into t7810-grep.sh
> - Simplify the test prerequisite evaluation

The tests certainly look better, and as v3, the build procedure sounds OK.

Show 25 quoted lines
> diff --git a/common-main.c b/common-main.c
> index c531372f3f..0a22861f1c 100644
> --- a/common-main.c
> +++ b/common-main.c
> @@ -40,6 +40,7 @@ int main(int argc, const char **argv)
>  
>  	git_resolve_executable_dir(argv[0]);
>  
> +	setlocale(LC_CTYPE, "");
>  	git_setup_gettext();
>  
>  	initialize_the_repository();
> ...
> diff --git a/git-compat-util.h b/git-compat-util.h
> index 58d7708296..c6fa3c7469 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -212,6 +212,7 @@
>  #endif
>  #include <errno.h>
>  #include <limits.h>
> +#include <locale.h>
>  #ifdef NEEDS_SYS_PARAM_H
>  #include <sys/param.h>
>  #endif

I'll let others more familiar with the locale support to comment on these changes. We are unconditionally including <locale.h> now; platforms that lack <locale.h> could set NO_GETTEXT to work it around before this change, but that will no longer work.

I do not know if thta is a practical downside to anybody, but it could be a problem.

Perhaps cook this in 'next' and see if anybody screams?
Thanks.
Previous: Diomidis SpinellisNext: Diomidis Spinellis
Message 2 of 4 in “grep: fix multibyte regex handling under macOS”
  1. grep: fix multibyte regex handling under macOSDiomidis Spinellis, Aug 26, 2022
  2. Junio C HamanoSep 13, 2022
  3. Diomidis SpinellisSep 13, 2022
  4. Junio C HamanoSep 13, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.