mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2025-03-15 04:25:06 +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);
|
||||||
result = StrReplace(result, " ", "",, TRUE);
|
result = StrReplace(result, " ", "",, TRUE);
|
||||||
|
|
||||||
|
if (StrLen(result) > 22)
|
||||||
|
result[21] = 0; // truncate filename len
|
||||||
|
|
||||||
SysLog("%s\n", result);
|
SysLog("%s\n", result);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -166,11 +169,7 @@ U0 GopherTextView(U8 *host, U16 port, U8 *selector)
|
||||||
|
|
||||||
DirMake("::/Tmp/Gopher");
|
DirMake("::/Tmp/Gopher");
|
||||||
|
|
||||||
tmpname = StrNew(selector);
|
basename = ExtChange(GopherBasename(selector), "TXT");
|
||||||
if (StrLen(tmpname) > 22)
|
|
||||||
tmpname[21] = 0; // too long, terminate it early
|
|
||||||
basename = ExtChange(GopherBasename(tmpname), "TXT");
|
|
||||||
Free(tmpname);
|
|
||||||
tmpname = StrPrint(NULL, "::/Tmp/Gopher/%s", basename);
|
tmpname = StrPrint(NULL, "::/Tmp/Gopher/%s", basename);
|
||||||
Free(basename);
|
Free(basename);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue