GNU bug report logs -
#49271
28.0.50: native-comp: Signing macOS self-contained .app bundle fails due to new *.eln location
Previous Next
Reported by: Jim Myhrberg <contact <at> jimeh.me>
Date: Tue, 29 Jun 2021 11:59:02 UTC
Severity: normal
Found in version 28.0.50
Done: Alan Third <alan <at> idiocy.org>
Bug is archived. No further changes may be made.
Full log
Message #35 received at 49271 <at> debbugs.gnu.org (full text, mbox):
> Date: Wed, 30 Jun 2021 20:05:50 +0100
> From: Alan Third <alan <at> idiocy.org>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 49271 <at> debbugs.gnu.org
>
> Eli, is this an acceptable way of modifying a lisp string, or is there
> a better way?
> [...]
> +#ifdef NS_SELF_CONTAINED
> + /* MacOS self contained app bundles do not like having dots in the
> + directory names under the Contents/Frameworks directory, so
> + convert them to underscores. */
> +
> + char *str = xstrdup (SSDATA(version));
> +
> + for (ptrdiff_t c = 0 ; c < SBYTES (version) ; c++)
> + if (*(str + c) == '.')
> + *(str + c) = '_';
> +
> + version = build_string (str);
> + xfree (str);
> +#endif
It should work, although I'd prefer writing such code the other way
around: first create an uninitialized Lisp string (with
make_uninit_multibyte_string or make_uninit_string), then copy the
bytes while making the conversions. The reason for this preference is
that you could then make sure the produced string has the same
multibyte-ness as the original, whereas the way you did it relies on
whatever build_string decides, which is not necessarily the same.
Thanks.
This bug report was last modified 3 years and 325 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.