Improve error message for file:seek and file:setvbuf.
This commit is contained in:
@@ -431,7 +431,7 @@ public class IoLib extends TwoArgFunction {
|
|||||||
} else if ("full".equals(mode)) {
|
} else if ("full".equals(mode)) {
|
||||||
} else if ("line".equals(mode)) {
|
} else if ("line".equals(mode)) {
|
||||||
} else {
|
} else {
|
||||||
argerror(1, "invalid option '" + mode + "', must be one of 'no', 'full' or 'line'");
|
argerror(1, "invalid value: '" + mode + "'; must be one of 'no', 'full' or 'line'");
|
||||||
}
|
}
|
||||||
checkfile(file).setvbuf(mode,size);
|
checkfile(file).setvbuf(mode,size);
|
||||||
return LuaValue.TRUE;
|
return LuaValue.TRUE;
|
||||||
@@ -453,7 +453,7 @@ public class IoLib extends TwoArgFunction {
|
|||||||
} else if ("end".equals(whence)) {
|
} else if ("end".equals(whence)) {
|
||||||
} else if ("cur".equals(whence)) {
|
} else if ("cur".equals(whence)) {
|
||||||
} else {
|
} else {
|
||||||
argerror(1, "invalid option '" + whence + "', must be one of 'set', 'cur' or 'end'");
|
argerror(1, "invalid value: '" + whence + "'; must be one of 'set', 'cur' or 'end'");
|
||||||
}
|
}
|
||||||
return valueOf( checkfile(file).seek(whence,offset) );
|
return valueOf( checkfile(file).seek(whence,offset) );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user