gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] a small suggestion


From: Jose Vilmar Estacio de Souza
Subject: [open-cobol-list] a small suggestion
Date: Mon Jan 9 14:51:04 2006

Hi all,
When OC find an I-O error in a file and the file does not have a file status clause, the program is aborted with an appropriated message. However the name of the file is not shown in the message. In my opinion it would be very nice if the external name of the file was displayed together with the error message.
I'm sending a small patch that tries to address this situation.


--- fileio.c.ori 2006-01-09 19:48:42.727692800 -0200
+++ fileio.c 2006-01-09 20:00:04.407900800 -0200
@@ -1924,6 +1924,7 @@
cob_default_error_handle (void)
{
 const char *msg = NULL;
+ char   filename[COB_MEDIUM_BUFF];
 char  *file_status = cob_error_file->file_status;
 int  status = cob_d2i (file_status[0]) * 10 + cob_d2i (file_status[1]);

@@ -1989,7 +1990,8 @@
 }

 if (msg) {
-  cob_runtime_error ("%s (STATUS=%02d)", gettext (msg), status);
+         cob_field_to_string (cob_error_file->assign, filename);
+ cob_runtime_error ("%s (STATUS=%02d). %s", gettext (msg), status, filename);
 }
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]