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> ...@@ -103,10 +103,10 @@ template <typename LOC>
static void static void
location_dump( const char func[], int line, const char tag[], const LOC& loc) { location_dump( const char func[], int line, const char tag[], const LOC& loc) {
extern int yy_flex_debug; 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", fprintf(stderr, "%s:%d: %s location (%d,%d) to (%d,%d)\n",
func, line, tag, func, line, tag,
loc.first_line, loc.first_column, loc.last_line, loc.last_column); loc.first_line, loc.first_column, loc.last_line, loc.last_column);
} }
#endif // defined(yy_flex_debug) #endif // defined(yy_flex_debug)
......
...@@ -278,20 +278,20 @@ copybook_elem_t::open_file( const char directory[], bool literally ) { ...@@ -278,20 +278,20 @@ copybook_elem_t::open_file( const char directory[], bool literally ) {
} else { } else {
const char *dir = directory? directory : library.name; const char *dir = directory? directory : library.name;
path = xasprintf( "%s/%s", dir, source.name ); path = xasprintf( "%s/%s", dir, source.name );
} }
} else { } else {
path = xasprintf( "%s", source.name ); path = xasprintf( "%s", source.name );
} }
gcc_assert(path); gcc_assert(path);
if( literally ) { if( literally ) {
dbgmsg("copybook_elem_t::open_file: trying %s", path); dbgmsg("copybook_elem_t::open_file: trying %s", path);
if( (this->fd = open(path, O_RDONLY)) == -1 ) { if( (this->fd = open(path, O_RDONLY)) == -1 ) {
dbgmsg("could not open %s: %m", path); dbgmsg("could not open %s: %m", path);
return fd; return fd;
} }
this->source.name = path; this->source.name = path;
if( ! cobol_filename(this->source.name, inode_of(fd)) ) { if( ! cobol_filename(this->source.name, inode_of(fd)) ) {
error_msg(source.loc, "recursive copybook: '%s' includes itself", path); error_msg(source.loc, "recursive copybook: '%s' includes itself", path);
...@@ -301,7 +301,7 @@ copybook_elem_t::open_file( const char directory[], bool literally ) { ...@@ -301,7 +301,7 @@ copybook_elem_t::open_file( const char directory[], bool literally ) {
return fd; return fd;
} }
gcc_assert( ! literally ); gcc_assert( ! literally );
if( extensions ) { if( extensions ) {
pattern = xasprintf("%s{,.cpy,.CPY,.cbl,.CBL,.cob,.COB,%s}", pattern = xasprintf("%s{,.cpy,.CPY,.cbl,.CBL,.cob,.COB,%s}",
path, this->extensions); path, this->extensions);
......
...@@ -92,7 +92,7 @@ class copybook_elem_t { ...@@ -92,7 +92,7 @@ class copybook_elem_t {
int open_file( const char dir[], bool literally = false ); int open_file( const char dir[], bool literally = false );
void extensions_add( const char ext[], const char alt[] ); void extensions_add( const char ext[], const char alt[] );
static inline bool is_quote( const char ch ) { static inline bool is_quote( const char ch ) {
return ch == '\'' || ch == '"'; return ch == '\'' || ch == '"';
} }
...@@ -145,7 +145,7 @@ class copybook_t { ...@@ -145,7 +145,7 @@ class copybook_t {
} }
if( false && value != uname ) { if( false && value != uname ) {
dbgmsg("using copybook file '%s' from environment variable '%s'", dbgmsg("using copybook file '%s' from environment variable '%s'",
value, name); value, name);
} }
return xstrdup(value); return xstrdup(value);
} }
...@@ -184,9 +184,9 @@ class copybook_t { ...@@ -184,9 +184,9 @@ class copybook_t {
for( auto dir : directories ) { for( auto dir : directories ) {
if( true ) { if( true ) {
dbgmsg("copybook_t::open '%s' OF '%s' %s", dbgmsg("copybook_t::open '%s' OF '%s' %s",
book.source.name, book.source.name,
dir? dir: ".", dir? dir: ".",
book.literally.source? ", literally" : "" ); book.literally.source? ", literally" : "" );
} }
if( (fd = book.open_file(dir, book.literally.source)) != -1 ) break; 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