Core: LocalProcess now returns at max ~1KB in Read in Posix too

git-svn-id: svn://ultimatepp.org/upp/trunk@11102 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2017-05-18 07:47:45 +00:00
parent cc071e4b18
commit e612643f04
3 changed files with 6 additions and 6 deletions

View file

@ -510,7 +510,7 @@ bool LocalProcess::Read2(String& reso, String& rese)
FD_SET(pipe[0], set);
timeval tval = { 0, 0 };
int sv;
while((sv = select(pipe[0]+1, set, NULL, NULL, &tval)) > 0) {
if((sv = select(pipe[0]+1, set, NULL, NULL, &tval)) > 0) {
LLOG("Read() -> select");
char buffer[1024];
int done = read(pipe[0], buffer, sizeof(buffer));

View file

@ -39,9 +39,8 @@ tring]_[*@3 s])_`=_[@3 0]&]
[s4; &]
[s5;:AProcess`:`:Read`(String`&`): [@(0.0.255) virtual] [@(0.0.255) bool]_[* Read]([_^topic`:`/`/Core`/src`/String`$en`-us`#String`:`:class^ S
tring][@(0.0.255) `&]_[*@3 s])_`=_[@3 0]&]
[s2;%% Reads data from standard output combined with standard error
output. Returns true if there process was running or there are
more data to be read.&]
[s2;%% Reads data from standard output combined. Returns true if
the process was running or there are more data to be read.&]
[s3;%% &]
[s4; &]
[s5;:AProcess`:`:Read2`(String`&`,String`&`): [@(0.0.255) virtual]
@ -49,7 +48,7 @@ more data to be read.&]
tring][@(0.0.255) `&]_[*@3 os], [_^topic`:`/`/Core`/src`/String`$en`-us`#String`:`:class^ S
tring][@(0.0.255) `&]_[*@3 es])&]
[s2;%% Reads data separately from standard output combined and from
standard error output. Returns true if there process was running
standard error output. Returns true if the process was running
or there are more data to be read. Usually, implementing class
has to be in special mode for this to work (e.g. LocalProcess
must be started with Start2).&]

View file

@ -318,13 +318,14 @@ void TextCompareCtrl::Paint(Draw& draw)
if(show_diff_highlight) {
WString ln_diff = l.text_diff.ToWString();
ln_diff = ExpandTabs(ln_diff);
if(ln_diff.GetCount() * ln.GetCount() < 50000)
if(ln_diff.GetCount() * ln.GetCount() < 50000) {
if(left)
LineDiff(true, hln, SColorPaper(),
~ln, 0, ln.GetCount(), ~ln_diff, 0, ln_diff.GetCount(), 0);
else
LineDiff(false, hln, SColorPaper(),
~ln_diff, 0, ln_diff.GetCount(), ~ln, 0, ln.GetCount(), 0);
}
}
if(show_white_space) {
for(int i = ln.GetCount(); i >= 0; --i) {