Skip to content

Commit

Permalink
xxx
Browse files Browse the repository at this point in the history
  • Loading branch information
lefessan committed Mar 15, 2024
1 parent 30d087e commit 42adc9f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions cobc/cobc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
10 changes: 5 additions & 5 deletions cobc/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ 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
/* Returns the argument with backslashes replaced by slashes
in filenames. Second argument explains whether the result should be
set in place or reallocated.
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 *
Expand All @@ -89,8 +92,6 @@ print_error_prefix (const char *file, int line, const char *prefix)
{
if (file) {
char *absfile = NULL ;
char *tmpfile = cobc_slashify (file);
file = tmpfile;
if (cb_diagnostics_absolute_paths
&& strcmp (file, COB_DASH) != 0
&& file[0] != '/'
Expand Down Expand Up @@ -124,7 +125,6 @@ print_error_prefix (const char *file, int line, const char *prefix)
fprintf (stderr, "%s:%d: ", file, line);
}
if (absfile) cobc_free (absfile);
cobc_free (tmpfile);
}
if (prefix) {
fprintf (stderr, "%s", prefix);
Expand Down
3 changes: 2 additions & 1 deletion cobc/pplex.l
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,8 @@ ppcopy (const char *name, const char *lib, struct cb_replace_list *replace_list)
/* ensure to have errno from name as specified, not from another file */
(void)access (plexbuff1, R_OK);
/* pass file error as we have no more places to check */
cb_error ("%s: %s", plexbuff1, cb_get_strerror ());
cb_error ("%s: %s",
cobc_slashify (plexbuff1), cb_get_strerror ());
}
}
}
Expand Down

0 comments on commit 42adc9f

Please sign in to comment.