1
0
mirror of https://github.com/cc65/cc65.git synced 2025-02-10 09:31:08 +00:00
Sidney Cadot ceac9f87ba Temporary fix for fgets() not using target-specific newline.
This patch provides a temporary fix for the issue where the fgets()
function did not use the target-specific newline character to
decide if it has reached the end of the line. It defaulted to the
value $0a, which is the newline character on only some targets.
The Atari, for example, has newline character $9b instead.

This patch is ugly, because the ca65 assembler that is used for
fgets doesn't currently accept C-type character escape sequences
as values. Ideally we'd be able to write:

		cmp #'\n'

And this would end up being translated to a compare-immediate
to the target-specific newline character.

Since that is impossible, this patch substitutes the equivalent,
but ugly, code:

		.byte $c9, "\n"

This works because $c9 is the opcode for cmp #imm, and the "\n"
string /is/ translated to the platform-specific newline character,
at least when the 'string_escapes' feature is enabled.
2024-12-18 07:44:52 +01:00
..
2022-08-28 20:08:13 +02:00
2022-08-28 22:37:33 +02:00
2016-03-16 16:28:32 +01:00
2022-08-28 22:37:33 +02:00
2022-08-29 19:55:48 +02:00
2022-08-29 19:55:48 +02:00
2022-04-17 16:06:22 +02:00
2022-08-28 22:37:33 +02:00
2024-02-02 19:45:49 +01:00
2024-01-18 09:09:38 +01:00
2022-04-17 16:06:22 +02:00
2020-04-02 22:58:16 +02:00
2022-08-28 22:37:33 +02:00
2024-01-30 19:40:28 +01:00
2020-04-02 22:58:16 +02:00
2022-04-17 16:06:22 +02:00
2024-01-18 09:09:38 +01:00
2022-04-17 16:06:22 +02:00
2016-06-13 20:40:01 +02:00
2024-01-24 09:58:09 +01:00
2024-02-02 19:45:49 +01:00
2024-01-24 09:58:09 +01:00
2022-08-28 22:37:33 +02:00
2024-01-30 19:40:28 +01:00
2024-01-30 19:40:28 +01:00
2024-02-02 19:45:49 +01:00
2022-08-29 19:55:48 +02:00
2022-04-17 16:06:22 +02:00
2024-02-02 19:45:49 +01:00
2019-02-05 23:27:52 +01:00
2024-01-26 20:29:17 +01:00
2024-01-08 18:24:13 +01:00
2020-04-02 22:58:16 +02:00
2020-04-02 22:58:16 +02:00
2022-08-04 00:25:04 +02:00
2020-04-02 22:58:16 +02:00
2020-04-02 22:58:16 +02:00
2020-04-02 22:58:16 +02:00
2020-04-02 22:58:16 +02:00
2020-04-02 22:58:16 +02:00
2020-04-02 22:58:16 +02:00
2020-04-02 22:58:16 +02:00
2020-04-02 22:58:16 +02:00
2020-04-02 22:58:16 +02:00
2020-04-02 22:58:16 +02:00
2024-01-08 18:24:13 +01:00
2022-04-17 16:06:22 +02:00
2017-06-09 16:57:47 +03:00
2024-01-24 09:54:54 +01:00
2020-12-27 18:22:12 -05:00
2022-04-17 16:06:22 +02:00
2022-08-28 22:37:33 +02:00
2024-01-18 09:09:38 +01:00
2022-04-17 16:06:22 +02:00
2022-04-17 16:06:22 +02:00
2023-09-07 16:48:56 +02:00
2023-09-07 16:48:56 +02:00
2024-01-24 09:58:09 +01:00
2020-07-21 23:44:36 +02:00
2024-01-26 20:25:59 +01:00
2022-08-28 22:37:33 +02:00
2022-04-17 16:06:22 +02:00
2022-08-28 22:37:33 +02:00
2022-08-28 20:05:11 +02:00
2022-08-28 22:37:33 +02:00
2022-08-28 22:37:33 +02:00
2019-04-13 11:25:54 +02:00
2024-09-07 21:24:53 +02:00
2024-04-19 07:57:47 +02:00
2024-09-07 21:24:53 +02:00
2024-01-07 14:25:06 +01:00
2024-01-07 14:25:06 +01:00
2024-12-09 18:37:02 +01:00
2020-04-02 22:58:16 +02:00
2024-01-07 14:25:06 +01:00
2020-04-02 22:58:16 +02:00
2022-04-17 16:06:22 +02:00
2020-12-27 17:54:49 -05:00
2020-12-27 17:54:49 -05:00
2021-12-25 09:11:58 +01:00
2018-05-29 14:29:50 -04:00
2022-04-17 16:06:22 +02:00
2024-01-07 14:25:06 +01:00
2024-04-19 07:57:47 +02:00
2020-04-02 22:58:16 +02:00
2024-09-12 09:14:57 +02:00
2020-04-02 22:58:16 +02:00
2022-08-28 22:37:33 +02:00
2024-01-24 09:58:09 +01:00
2022-08-28 22:37:33 +02:00
2022-04-17 16:06:22 +02:00