On Sat, Jan 4, 2025 at 12:22 AM Bruno Haible wrote:
> Hi Jim,
Hi again :-)
> > I'm surprised that you would use "more sources use Y" as a rationale
> > for using Y.
>
> I do so for language-related topics. Because language gets defined by
> how people use it in their majority.
>
> Like you, I'm
Paul Eggert wrote:
> > if (!mbi_avail (iter))
> > -abort ();
> > +/* We can get here due to incomplete multibyte characters.
> > */
> > +return false;
> > mbi_advance (iter);
>
> If the string ends in an incomplete s
Paul Eggert wrote:
> >> * What happens when strings contain encoding errors? It's not clear from
> >> the spec. I hope behavior isn't simply undefined.
> >
> > When the str_* functions are used, the byte-wise encoding will matter.
>
> I thought that str_* functions didn't care about locale, which
On 2025-01-04 09:25, Bruno Haible wrote:
if (!mbi_avail (iter))
-abort ();
+/* We can get here due to incomplete multibyte characters. */
+return false;
mbi_advance (iter);
If the string ends in an incomplete seque
This is part of my attempt to merge glibc and gnulib mktime.c.
It should not affect Gnulib-using code.
* lib/mktime.c [_LIBC]: Include .
(convert_time, __tz_convert) [_LIBC]: Omit definitions,
since glibc supplies __tz_convert internally.
(__mktime64) [_LIBC]: Lock __tzset_lock while running.
---
* lib/mktime.c (__mktime_internal): Use bool for a boolean local.
---
ChangeLog| 5 +
lib/mktime.c | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 06819500ab..335a97d8cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-01-04
* lib/mktime.c (__mktime_internal): When tm_isdst disagrees with
what was requested, search at most a year (+ stride) from the
requested time for a matching tm_isdst, and ignore the request if
the search fails. This is more likely to match user expectations
in timezones like Asia/Kolkata.
Problem
On 2025-01-04 19:23, Bruno Haible wrote:
Does this revert the change from
https://git.savannah.gnu.org/gitweb/?
p=gnulib.git;a=commitdiff;h=836c32a5915826c529b310981a149050bdd9db14
that was done for the sake of 'timegm'?
Or is that change now implemented in a different way?
It's now implemen
This shouldn't affect behavior of either Gnulib or glibc.
* lib/mktime-internal.h (__libc_lock_lock, __libc_lock_unlock)
(__tzset_unlocked) [!_LIBC]: New macros.
* lib/mktime.c (tzset) [!_LIBC]: Define this instead of __tzset,
if defining either.
(__mktime64): Simplify now that mktime-internal defi
Hi Simon,
> Would adding mem_startswith (arbitrary char* buffers) and/or
> c_startswith (arbitrary NUL-terminated 7-bit strings) make sense?
c_startswith and str_startswith are the same.
mem_startswith and mem_endswith would make sense, if some package needs them.
We already have them in the for
Hi Jim,
> I'm surprised that you would use "more sources use Y" as a rationale
> for using Y.
I do so for language-related topics. Because language gets defined by
how people use it in their majority.
Like you, I'm not generally in favour of accepting majority votes
- for determining what are
Paul Eggert wrote:
> > Should we break the "tradition" here to use 'int' for a Boolean value,
> > and actually use 'bool' for the first time in ?
>
> I would prefer it, if it's a boolean function.
Done:
2025-01-04 Bruno Haible
*_startswith, *_endswith: Change return type to 'bool'.
Paul Eggert wrote:
> > I don't know what to do about it. Generate an 'info' file with a
> > page width of 100 instead of 80? Splitting each table into 2 tables,
> > thus making it harder for the reader to get a synopsis?
>
> Maybe hyphenation? No solution is good here.
Automatic hyphenation is no
On 2025-01-03 23:39, Paul Eggert wrote:
Don't we have problems with mbs_startswith, though? If the prefix ends
in an incomplete multibyte character (an encoding error), the current
code can match that to part of a multibyte character in the string. This
doesn't match what you'd get if you ran m
On 2025-01-04 09:37, Bruno Haible wrote:
No, that unfortunate property ... is a problem with the BIG5-HKSCS encoding,
not with the
GB18030 encoding. (Recall that GB18030 is more-or-less a Unicode
transformation format like UTF-8, UTF-16, UTF-32.) See
https://www.gnu.org/software/gnulib/manual/ht
Paul Eggert wrote:
> Come to think of it, isn't there a different problem with
> mbs_startswith? As I recall, mbiter supports GB18030, which has the
> unfortunate property that an indivisible sequence of encoding bytes
> stands for two Unicode characters
No, that unfortunate property (that part
Paul Eggert wrote:
> --- a/lib/mktime.c
> +++ b/lib/mktime.c
> @@ -355,9 +355,7 @@ __mktime_internal (struct tm *tp, bool local,
> mktime_offset_t *offset)
>int mday = tp->tm_mday;
>int mon = tp->tm_mon;
>int year_requested = tp->tm_year;
> -
> - /* Ignore any tm_isdst request for tim
17 matches
Mail list logo