Skip to content
Snippets Groups Projects
Commit c5bdb264 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Character 255 is a non-breaking space in CP437

Now IS_WHITESPACE() will return true for that char and this allows things like truncsp() to truncate trailing white-space (e.g. from a FILE_ID.DIZ), even if it contains a terminating 0xFF character for some unknown reason.
parent 6beb55ae
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -37,6 +37,7 @@
#ifndef _GEN_DEFS_H
#define _GEN_DEFS_H
#include "cp437defs.h"
#include <errno.h>
/* Resolve multi-named errno constants */
......@@ -451,7 +452,7 @@ typedef struct {
/* ASCIIZ char* parsing helper macros */
/* These (unsigned char) typecasts defeat MSVC debug assertion when passed a negative value */
#define IS_WHITESPACE(c) isspace((unsigned char)(c))
#define IS_WHITESPACE(c) (isspace((unsigned char)(c)) || c == CP437_NO_BREAK_SPACE)
#define IS_CONTROL(c) iscntrl((unsigned char)(c))
#define IS_ALPHA(c) isalpha((unsigned char)(c))
#define IS_ALPHANUMERIC(c) isalnum((unsigned char)(c))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment