aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--spec/util_dbuffer_spec.lua2
-rw-r--r--util/dbuffer.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/spec/util_dbuffer_spec.lua b/spec/util_dbuffer_spec.lua
index 26fa7da6..554a7e54 100644
--- a/spec/util_dbuffer_spec.lua
+++ b/spec/util_dbuffer_spec.lua
@@ -67,7 +67,7 @@ describe("util.dbuffer", function ()
assert.equals("hello", b:sub(1, 5));
end);
- pending("works after discard", function ()
+ it("works after discard", function ()
local b = dbuffer.new(256);
assert.truthy(b:write("foo"));
assert.truthy(b:write("bar"));
diff --git a/util/dbuffer.lua b/util/dbuffer.lua
index 9ec40eb9..a50f3a64 100644
--- a/util/dbuffer.lua
+++ b/util/dbuffer.lua
@@ -123,7 +123,7 @@ function dbuffer_methods:sub(i, j)
self:collapse(j);
- return self.items:peek():sub(i, j);
+ return self.items:peek():sub(self.front_consumed+1):sub(i, j);
end
function dbuffer_methods:byte(i, j)