mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 23:10:32 +00:00
Fix Gopher client filename truncation bug.
This commit is contained in:
parent
415edf731d
commit
dc66f78d51
1 changed files with 4 additions and 5 deletions
|
@ -154,6 +154,9 @@ U8 *GopherBasename(U8 *selector)
|
|||
result = StrReplace(result, ">", "",, TRUE);
|
||||
result = StrReplace(result, " ", "",, TRUE);
|
||||
|
||||
if (StrLen(result) > 22)
|
||||
result[21] = 0; // truncate filename len
|
||||
|
||||
SysLog("%s\n", result);
|
||||
|
||||
return result;
|
||||
|
@ -166,11 +169,7 @@ U0 GopherTextView(U8 *host, U16 port, U8 *selector)
|
|||
|
||||
DirMake("::/Tmp/Gopher");
|
||||
|
||||
tmpname = StrNew(selector);
|
||||
if (StrLen(tmpname) > 22)
|
||||
tmpname[21] = 0; // too long, terminate it early
|
||||
basename = ExtChange(GopherBasename(tmpname), "TXT");
|
||||
Free(tmpname);
|
||||
basename = ExtChange(GopherBasename(selector), "TXT");
|
||||
tmpname = StrPrint(NULL, "::/Tmp/Gopher/%s", basename);
|
||||
Free(basename);
|
||||
|
||||
|
|
Loading…
Reference in a new issue