|
@@ -81,11 +81,11 @@ static struct uri * parse_next_server_and_filename ( struct in_addr next_server,
|
81
|
81
|
* filenames with and without initial slashes, which is
|
82
|
82
|
* significant for TFTP.
|
83
|
83
|
*/
|
84
|
|
- if ( ! uri_is_absolute ( uri ) ) {
|
|
84
|
+ if ( next_server.s_addr && filename[0] && ! uri_is_absolute ( uri ) ) {
|
85
|
85
|
uri_put ( uri );
|
86
|
86
|
snprintf ( buf, sizeof ( buf ), "tftp://%s/%s",
|
87
|
87
|
inet_ntoa ( next_server ), filename );
|
88
|
|
- uri = parse_uri ( filename );
|
|
88
|
+ uri = parse_uri ( buf );
|
89
|
89
|
if ( ! uri )
|
90
|
90
|
return NULL;
|
91
|
91
|
}
|
|
@@ -130,7 +130,7 @@ int uriboot ( struct uri *filename, struct uri *root_path ) {
|
130
|
130
|
}
|
131
|
131
|
|
132
|
132
|
/* Treat empty URIs as absent */
|
133
|
|
- if ( filename && ( ! filename->path ) )
|
|
133
|
+ if ( filename && ( ! uri_has_path ( filename ) ) )
|
134
|
134
|
filename = NULL;
|
135
|
135
|
if ( root_path && ( ! uri_is_absolute ( root_path ) ) )
|
136
|
136
|
root_path = NULL;
|