mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Make improvements
- Expand redbean UNIX module - Expand redbean documentation - Ensure Lua copyright is embedded in binary - Increase the PATH_MAX limit especially on NT - Use column major sorting for linenoise completions - Fix some suboptimalities in redbean's new UNIX API - Figured out right flags for Multics newline in raw mode
This commit is contained in:
parent
cf3174dc74
commit
2046c0d2ae
305 changed files with 6602 additions and 4221 deletions
|
@ -167,7 +167,7 @@ local function main()
|
|||
Write('<dt>GetRemoteAddr() <small>(from Berkeley Sockets or X-Forwarded-For header)</small>\r\n')
|
||||
Write('<dd>')
|
||||
ip, port = GetRemoteAddr()
|
||||
Write(string.format('%s, %d', FormatIp(ip), port))
|
||||
Write('%s, %d' % {FormatIp(ip), port})
|
||||
if CategorizeIp(ip) then
|
||||
Write('<br>\r\n')
|
||||
Write(CategorizeIp(ip))
|
||||
|
@ -176,7 +176,7 @@ local function main()
|
|||
Write('<dt>GetClientAddr()\r\n')
|
||||
Write('<dd>')
|
||||
ip, port = GetClientAddr()
|
||||
Write(string.format('%s, %d', FormatIp(ip), port))
|
||||
Write('%s, %d' % {FormatIp(ip), port})
|
||||
if CategorizeIp(ip) then
|
||||
Write('<br>\r\n')
|
||||
Write(CategorizeIp(ip))
|
||||
|
@ -185,7 +185,7 @@ local function main()
|
|||
Write('<dt>GetServerIp()\r\n')
|
||||
Write('<dd>')
|
||||
ip, port = GetServerAddr()
|
||||
Write(string.format('%s, %d', FormatIp(ip), port))
|
||||
Write('%s, %d' % {FormatIp(ip), port})
|
||||
if CategorizeIp(ip) then
|
||||
Write('<br>\r\n')
|
||||
Write(CategorizeIp(ip))
|
||||
|
@ -269,28 +269,28 @@ local function main()
|
|||
m,a,b,c,d = pat:search(s) -- m and rest are nil if match not found
|
||||
Write('<pre>\r\n')
|
||||
Write([[pat = re.compile('([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})')]])
|
||||
Write(string.format('\r\nm,a,b,c,d = pat:search(%q)\r\n', s))
|
||||
Write('\r\nm,a,b,c,d = pat:search(%q)\r\n' % {s})
|
||||
Write('</pre>\r\n')
|
||||
Write('<dl>\r\n')
|
||||
Write('<dt>m\r\n')
|
||||
Write('<dd>')
|
||||
Write(string.format("%q", m))
|
||||
Write("%q" % {m})
|
||||
Write('\r\n')
|
||||
Write('<dt>a\r\n')
|
||||
Write('<dd>')
|
||||
Write(string.format("%q", a))
|
||||
Write("%q" % {a})
|
||||
Write('\r\n')
|
||||
Write('<dt>b\r\n')
|
||||
Write('<dd>')
|
||||
Write(string.format("%q", b))
|
||||
Write("%q" % {b})
|
||||
Write('\r\n')
|
||||
Write('<dt>c\r\n')
|
||||
Write('<dd>')
|
||||
Write(string.format("%q", c))
|
||||
Write("%q" % {c})
|
||||
Write('\r\n')
|
||||
Write('<dt>d\r\n')
|
||||
Write('<dd>')
|
||||
Write(string.format("%q", d))
|
||||
Write("%q" % {d})
|
||||
Write('\r\n')
|
||||
Write('</dl>\r\n')
|
||||
|
||||
|
@ -328,7 +328,7 @@ local function main()
|
|||
Write(FormatHttpDateTime(GetLastModifiedTime(paths[i])))
|
||||
Write('<br>\r\n')
|
||||
Write('Mode: ')
|
||||
Write(string.format("0%o", GetAssetMode(paths[i])))
|
||||
Write("0%o" % {GetAssetMode(paths[i])})
|
||||
Write('<br>\r\n')
|
||||
Write('Size: ')
|
||||
Write(tostring(GetAssetSize(paths[i])))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue