From 30d087eaeca5454eca3dba0ed4bf0a8f0f204c89 Mon Sep 17 00:00:00 2001 From: Fabrice Le Fessant Date: Fri, 15 Mar 2024 11:22:53 +0100 Subject: [PATCH] xxx --- cobc/cobc.c | 23 +---------------------- cobc/cobc.h | 1 + cobc/error.c | 24 ++++++++++++++++++++++++ cobc/typeck.c | 1 + tests/testsuite.src/used_binaries.at | 23 +++++++++++------------ 5 files changed, 38 insertions(+), 34 deletions(-) diff --git a/cobc/cobc.c b/cobc/cobc.c index 52b2bc60b..e7137c4e7 100644 --- a/cobc/cobc.c +++ b/cobc/cobc.c @@ -9220,27 +9220,6 @@ finish_setup_internal_env (void) CB_TEXT_LIST_CHK (cb_include_list, COB_COPY_DIR); } -/* Replace a copy of the argument with backslashes replaced by slashes -in filenames. Note that all Windows system calls accept slashes -instead of backslashes. Only a few tools force the use of slashes, -such as the cmd shell. */ -static char * -slashify (const char *src) -{ - int i; - int len = strlen (src); - char *dst = cobc_malloc (len+1); - for (i=0; inext) { - char* filename = slashify (l->text); + char* filename = cobc_slashify (l->text); fprintf (file, " %s%s", filename, l->next ? sep : "\n\n"); cobc_free (filename); } diff --git a/cobc/cobc.h b/cobc/cobc.h index 86771c8f2..b01338e45 100644 --- a/cobc/cobc.h +++ b/cobc/cobc.h @@ -669,6 +669,7 @@ DECLNORET extern void flex_fatal_error (const char *, const char *, DECLNORET extern void cobc_terminate_exit (const char *, const char *) COB_A_NORETURN; extern void cobc_set_listing_header_code (void); +extern char * cobc_slashify (const char *); /* reserved.c */ extern struct reserved_word_list *cobc_user_res_list; diff --git a/cobc/error.c b/cobc/error.c index 9c971d66e..447900f5a 100644 --- a/cobc/error.c +++ b/cobc/error.c @@ -63,11 +63,34 @@ size_t cb_msg_style; DECLNORET static void cobc_too_many_errors (void) COB_A_NORETURN; +/* Returns a copy of the argument with backslashes replaced by slashes +in filenames. Note that all Windows system calls accept slashes +instead of backslashes. Only a few tools force the use of slashes, +such as the cmd shell. */ +char * +cobc_slashify (const char *src) +{ + int i; + int len = strlen (src); + char *dst = cobc_malloc (len+1); + for (i=0; i