[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [COMMITTED] pkl-diag: skip detailed location generation for non-seek
From: |
Jose E. Marchesi |
Subject: |
Re: [COMMITTED] pkl-diag: skip detailed location generation for non-seekable inputs |
Date: |
Tue, 09 Apr 2024 19:03:04 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Thanks.
> 2024-04-09 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
>
> * libpoke/pkl-diag.c (pkl_detailed_location): Handle the failure
> of `fseeko'.
> ---
>
>
> Also cherry-picked in maint/poke-4.
> Fixes https://sourceware.org/bugzilla/show_bug.cgi?id=31623.
>
>
>
> ChangeLog | 5 +++++
> libpoke/pkl-diag.c | 3 +++
> 2 files changed, 8 insertions(+)
>
> diff --git a/ChangeLog b/ChangeLog
> index e4120fcf..014233ce 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,8 @@
> +2024-04-09 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
> +
> + * libpoke/pkl-diag.c (pkl_detailed_location): Handle the failure
> + of `fseeko'.
> +
> 2024-04-08 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
>
> * libpoke/ios.c (realloc_string): Removed.
> diff --git a/libpoke/pkl-diag.c b/libpoke/pkl-diag.c
> index 2790388c..5675894f 100644
> --- a/libpoke/pkl-diag.c
> +++ b/libpoke/pkl-diag.c
> @@ -72,6 +72,9 @@ pkl_detailed_location (pkl_ast ast, pkl_ast_loc loc,
>
> /* Seek to the beginning of the file. */
> tmp = fseeko (fp, 0, SEEK_SET);
> + if (tmp == -1)
> + /* File is not seekable. Do not add detailed info. */
> + return;
> assert (tmp == 0);
>
> while ((c = fgetc (fp)) != EOF)