Skip to content

Commit

Permalink
Update dos_programs.cpp
Browse files Browse the repository at this point in the history
Insert back changes from pull request #4299 (Fixed garbled characters when using DBCS strings in title command), already merged in the main trunk but erased (by mistake) due to my latest VHDMAKE commits.
  • Loading branch information
maxpat78 authored Jun 7, 2023
1 parent e62dd92 commit 21b0032
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/dos/dos_programs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7741,6 +7741,8 @@ class TITLE : public Program {
}
};

bool CodePageGuestToHostUTF8(char *d/*CROSS_LEN*/,const char *s/*CROSS_LEN*/);

void TITLE::Run()
{
// Hack To allow long commandlines
Expand All @@ -7751,8 +7753,13 @@ void TITLE::Run()
PrintUsage();
return;
}
char *args=(char *)cmd->GetRawCmdline().c_str();
dosbox_title=trim(args);
char *args=trim((char *)cmd->GetRawCmdline().c_str());
char title[4096];
if(CodePageGuestToHostUTF8(title, args)) {
dosbox_title=title;
} else {
dosbox_title=args;
}
SetVal("dosbox", "title", dosbox_title);
GFX_SetTitle(-1,-1,-1,false);
}
Expand Down

0 comments on commit 21b0032

Please sign in to comment.