Skip to content
Snippets Groups Projects
Commit 55cdf110 authored by James K. Lowden's avatar James K. Lowden :anchor:
Browse files

whitepace

parent 296cb715
No related branches found
No related tags found
No related merge requests found
Pipeline #2473 failed
......@@ -103,10 +103,10 @@ template <typename LOC>
static void
location_dump( const char func[], int line, const char tag[], const LOC& loc) {
extern int yy_flex_debug;
if( yy_flex_debug && getenv("update_location") )
if( yy_flex_debug && getenv("update_location") )
fprintf(stderr, "%s:%d: %s location (%d,%d) to (%d,%d)\n",
func, line, tag,
loc.first_line, loc.first_column, loc.last_line, loc.last_column);
func, line, tag,
loc.first_line, loc.first_column, loc.last_line, loc.last_column);
}
#endif // defined(yy_flex_debug)
......
......@@ -278,20 +278,20 @@ copybook_elem_t::open_file( const char directory[], bool literally ) {
} else {
const char *dir = directory? directory : library.name;
path = xasprintf( "%s/%s", dir, source.name );
}
}
} else {
path = xasprintf( "%s", source.name );
}
gcc_assert(path);
if( literally ) {
dbgmsg("copybook_elem_t::open_file: trying %s", path);
if( (this->fd = open(path, O_RDONLY)) == -1 ) {
dbgmsg("could not open %s: %m", path);
return fd;
}
}
this->source.name = path;
if( ! cobol_filename(this->source.name, inode_of(fd)) ) {
error_msg(source.loc, "recursive copybook: '%s' includes itself", path);
......@@ -301,7 +301,7 @@ copybook_elem_t::open_file( const char directory[], bool literally ) {
return fd;
}
gcc_assert( ! literally );
if( extensions ) {
pattern = xasprintf("%s{,.cpy,.CPY,.cbl,.CBL,.cob,.COB,%s}",
path, this->extensions);
......
......@@ -92,7 +92,7 @@ class copybook_elem_t {
int open_file( const char dir[], bool literally = false );
void extensions_add( const char ext[], const char alt[] );
static inline bool is_quote( const char ch ) {
return ch == '\'' || ch == '"';
}
......@@ -145,7 +145,7 @@ class copybook_t {
}
if( false && value != uname ) {
dbgmsg("using copybook file '%s' from environment variable '%s'",
value, name);
value, name);
}
return xstrdup(value);
}
......@@ -184,9 +184,9 @@ class copybook_t {
for( auto dir : directories ) {
if( true ) {
dbgmsg("copybook_t::open '%s' OF '%s' %s",
book.source.name,
dir? dir: ".",
book.literally.source? ", literally" : "" );
book.source.name,
dir? dir: ".",
book.literally.source? ", literally" : "" );
}
if( (fd = book.open_file(dir, book.literally.source)) != -1 ) break;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment