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 42adc9f commit 5f9cf0c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions cobc/cobc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9313,7 +9313,9 @@ process_file (struct filename *fn, int status)
/* These lines should only be added with -MP */
if (cb_depend_add_phony){
for (l = cb_depend_list; l; l = l->next) {
char* filename = cobc_slashify (l->text);
fprintf (file, "%s:\n", l->text);
cobc_free (filename);
}
}
if (!cb_depend_file){
Expand Down
10 changes: 5 additions & 5 deletions cobc/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,8 @@ size_t cb_msg_style;

DECLNORET static void cobc_too_many_errors (void) COB_A_NORETURN;

/* 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
/* 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 *
Expand All @@ -92,6 +89,8 @@ 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 @@ -125,6 +124,7 @@ 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
2 changes: 1 addition & 1 deletion cobc/pplex.l
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ ppopen_get_file (const char *name)
ppin = fopen (name, "rb");
#endif
if (!ppin) {
cb_error ("%s: %s", name, cb_get_strerror ());
cb_error ("%s: %s", cobc_slashify (name), cb_get_strerror ());
/* Note: postpone error exit as we need the saved buffers later on */
return 0;
}
Expand Down

0 comments on commit 5f9cf0c

Please sign in to comment.