Hello im using function CmdRunner.ExecuteCommandWithStringResult("cm cat " + elem, Environment.CurrentDirectory) to get file from my repo. For some files i observed infinite loop, when my program hangs. During debugging i found that program constantly executes this line of code:
while (!TryToOpenFile(outputfile, ref sreader) && !proc.HasExited)
{
result = RunWait(
proc, initWait,
ref lastElapsed,
ref totSeconds,
out error);
if (result != 0)
return result;
}
in ReadFileOutputWindows() function in CodiceCmdRunner.cs
Further debugging showed me that line which causes this issue is this one:
if (line.StartsWith(COMMAND_RESULT))
when i observed last line of file i saw
}CommandResult 0
this bracket at beggining of line is last line of my file (just close bracket from some function from above). Due to this bracket at the beginning, bDone flag was never set to true and program went to infinite loop. So i swapped if (line.StartsWith(COMMAND_RESULT)) with if (line.Containd(COMMAND_RESULT)) and everything started to work correctly.
Hello im using function
CmdRunner.ExecuteCommandWithStringResult("cm cat " + elem, Environment.CurrentDirectory)to get file from my repo. For some files i observed infinite loop, when my program hangs. During debugging i found that program constantly executes this line of code:in
ReadFileOutputWindows()function in CodiceCmdRunner.csFurther debugging showed me that line which causes this issue is this one:
if (line.StartsWith(COMMAND_RESULT))when i observed last line of file i saw
this bracket at beggining of line is last line of my file (just close bracket from some function from above). Due to this bracket at the beginning,
bDoneflag was never set totrueand program went to infinite loop. So i swappedif (line.StartsWith(COMMAND_RESULT))withif (line.Containd(COMMAND_RESULT))and everything started to work correctly.