Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
401ded86
Commit
401ded86
authored
26 years ago
by
Marcus Comstedt
Browse files
Options
Downloads
Patches
Plain Diff
Ack!
Rev: lib/modules/Stdio.pmod/Terminfo.pmod:1.3
parent
dff4e455
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/Stdio.pmod/Terminfo.pmod
+11
-3
11 additions, 3 deletions
lib/modules/Stdio.pmod/Terminfo.pmod
with
11 additions
and
3 deletions
lib/modules/Stdio.pmod/Terminfo.pmod
+
11
−
3
View file @
401ded86
// $Id: Terminfo.pmod,v 1.
2
1999/03/17 23:
17:42
marcus Exp $
// $Id: Terminfo.pmod,v 1.
3
1999/03/17 23:
26:03
marcus Exp $
#if constant(thread_create)
#if constant(thread_create)
...
@@ -324,7 +324,7 @@ class Terminfo {
...
@@ -324,7 +324,7 @@ class Terminfo {
return Array.map(s/2, reverse)*"";
return Array.map(s/2, reverse)*"";
}
}
static private int load_cap(object f)
static private int load_cap(object f
, int|void bug_compat
)
{
{
int magic, sname, nbool, nnum, nstr, sstr;
int magic, sname, nbool, nnum, nstr, sstr;
...
@@ -334,7 +334,10 @@ class Terminfo {
...
@@ -334,7 +334,10 @@ class Terminfo {
return 0;
return 0;
aliases = (f->read(sname)-"\0")/"|";
aliases = (f->read(sname)-"\0")/"|";
{
{
array(int) bools = values(f->read(nbool/*+(nbool&1)*/)/*[..nbool-1]*/);
int blen = nbool;
if((nbool&1) && !bug_compat)
blen++;
array(int) bools = values(f->read(blen)[..nbool-1]);
if (sizeof(bools)>sizeof(boolnames))
if (sizeof(bools)>sizeof(boolnames))
bools = bools[..sizeof(boolnames)-1];
bools = bools[..sizeof(boolnames)-1];
map = mkmapping(boolnames[..sizeof(bools)-1], bools);
map = mkmapping(boolnames[..sizeof(bools)-1], bools);
...
@@ -352,6 +355,11 @@ class Terminfo {
...
@@ -352,6 +355,11 @@ class Terminfo {
{
{
string stroffs = swab(f->read(nstr*2));
string stroffs = swab(f->read(nstr*2));
string strbuf = f->read(sstr);
string strbuf = f->read(sstr);
if(strlen(strbuf)==sstr-1 && !bug_compat && (nbool&1)) {
// Ugh. Someone didn't pad their bool array properly (one suspects).
f->seek(0);
return load_cap(f, 1);
}
if(strlen(strbuf)!=sstr)
if(strlen(strbuf)!=sstr)
return 0;
return 0;
array(string) strarr = Array.map(array_sscanf(stroffs, "%2c"*nstr),
array(string) strarr = Array.map(array_sscanf(stroffs, "%2c"*nstr),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment