toolbox/emacsrunregion.m:

When extracting the text, don't overrun the array if the caller got it wrong.
This commit is contained in:
Eric Ludlam 2019-11-26 08:41:06 -05:00
parent b24f77d9d5
commit caaa6599f5

View file

@ -19,6 +19,6 @@ function emacsrunregion(file, startchar, endchar)
end
txt = fileread(file);
evalTxt = txt(startchar:endchar);
evalTxt = txt(startchar:min(endchar,length(txt)));
evalin('base',evalTxt);
end