changeset 392:e3567a9f0d54

Fixed problem with include path handling
author lost@l-w.ca
date Wed, 21 Jul 2010 22:21:35 -0600
parents c1d83336e1d1
children c94436adce83
files lwasm/input.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
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);