Skip to content

Commit

Permalink
Fixed startup path bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
AliceLR committed Dec 24, 2012
1 parent 77e9ed0 commit c211161
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ __libspec int main(int argc, char *argv[])
split_path_filename(argv[1], mzx_world.conf.startup_path, 256,
mzx_world.conf.startup_file, 256);

if(mzx_world.conf.startup_path)
if(mzx_world.conf.startup_path && strlen(mzx_world.conf.startup_path))
{
debug("Config: Using '%s' as startup path\n", mzx_world.conf.startup_path);
strncpy(current_dir, mzx_world.conf.startup_path, MAX_PATH);
}

chdir(current_dir);

Expand Down
3 changes: 3 additions & 0 deletions src/network/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,10 @@ enum host_status host_recv_file(struct host *h, const char *url,
if(line_len != 15 ||
strncmp(line, "HTTP/1.", 7) != 0 ||
strcmp(&line[7 + 1], " 200 OK") != 0)
{
warn("Invalid status: %s\nFailed for url '%s'\n", line, url);
return -HOST_HTTP_INVALID_STATUS;
}

// Now parse the HTTP headers, extracting only the pertinent fields

Expand Down

0 comments on commit c211161

Please sign in to comment.