Skip to content

Commit

Permalink
Merge SVN 4678
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeclerck committed Jun 21, 2024
1 parent 1710068 commit f7be8bc
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions libcob/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ cob_chk_file_env (cob_file *f, const char *src)
return NULL;
}

/* no mapping if filename begins with a slash [externally checked], hypen or digits
/* no mapping if filename begins with a slash [externally checked], hyphen or digits
(taken from "Programmer's Guide to File Handling, Chapter 2: File Naming") */
switch (*file_open_name) {
case '-':
Expand Down Expand Up @@ -1608,10 +1608,10 @@ looks_absolute (char *src)
return 0;
}

/* checks for special ACUCOBOL-case: file that start with hypen [note: -P not supported]
/* checks for special ACUCOBOL-case: file that start with hyphen [note: -P not supported]
no translation at all, name starts after first non-space */
static int
has_acu_hypen (char *src)
has_acu_hyphen (char *src)
{
if ( src[0] == '-'
&& (src[1] == 'F' || src[1] == 'D' || src[1] == 'f' || src[1] == 'd')
Expand All @@ -1623,7 +1623,7 @@ has_acu_hypen (char *src)

/* do acu translation, 'src' may not be file_open_buff! */
static void
do_acu_hypen_translation (char *src)
do_acu_hyphen_translation (char *src)
{
/* maybe store device type to "adjust locking rules" */
/* find first non-space and return it in the original storage */
Expand Down Expand Up @@ -1689,10 +1689,10 @@ cob_chk_file_mapping (cob_file *f, char *filename)
if (filename)
strcpy(file_open_name, filename);

/* Special ACUCOBOL-case: file that start with hypen [note: -P not supported]
/* Special ACUCOBOL-case: file that start with hyphen [note: -P not supported]
no translation at all, name starts after first non-space */
if (has_acu_hypen (file_open_name)) {
do_acu_hypen_translation (file_open_name);
if (has_acu_hyphen (file_open_name)) {
do_acu_hyphen_translation (file_open_name);
return ;
}

Expand Down Expand Up @@ -1752,8 +1752,8 @@ cob_chk_file_mapping (cob_file *f, char *filename)
if (looks_absolute (src)) {
return;
}
if (has_acu_hypen (file_open_name)) {
do_acu_hypen_translation (file_open_name);
if (has_acu_hyphen (file_open_name)) {
do_acu_hyphen_translation (file_open_name);
return ;
}
}
Expand Down

0 comments on commit f7be8bc

Please sign in to comment.