diff lwasm/input.c @ 392:e3567a9f0d54

Fixed problem with include path handling
author lost@l-w.ca
date Wed, 21 Jul 2010 22:21:35 -0600
parents af5f2c51db76
children
line wrap: on
line diff
--- a/lwasm/input.c	Wed Jul 21 21:26:43 2010 -0600
+++ b/lwasm/input.c	Wed Jul 21 22:21:35 2010 -0600
@@ -174,7 +174,7 @@
 				lw_error("Cannot open file '%s': %s", s, strerror(errno));
 			}
 			input_pushpath(as, s);
-			break;
+			return;
 		}
 		
 		/* relative path, check relative to "current file" directory */
@@ -186,8 +186,9 @@
 		{
 			input_pushpath(as, p2);
 			lw_free(p2);
-			break;
+			return;
 		}
+		debug_message(as, 2, "Failed to open: (cd) %s (%s)\n", p2, strerror(errno));
 		lw_free(p2);
 
 		/* now check relative to entries in the search path */
@@ -203,10 +204,12 @@
 				lw_free(p2);
 				return;
 			}
+		debug_message(as, 2, "Failed to open: (sp) %s (%s)\n", p2, strerror(errno));
 			lw_free(p2);
 			lw_stringlist_next(as -> include_list);
 		}
 		lw_error("Cannot open include file '%s': %s", s, strerror(errno));
+		break;
 		
 	case input_type_file:
 		debug_message(as, 1, "Opening (reg): %s\n", s);