From a160fd6984cc317c35fd8a2ad2120f482737fcfe Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 22 Mar 2013 18:39:00 +0100 Subject: [PATCH] open_fifo delete existing buffer if needed --- src/commands.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/commands.cc b/src/commands.cc index f8a5a74d..90ba937a 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -52,6 +52,9 @@ Buffer* open_fifo(const String& name , const String& filename, Context& context) fcntl(fd, F_SETFD, FD_CLOEXEC); if (fd < 0) throw runtime_error("unable to open " + filename); + + delete BufferManager::instance().get_buffer_ifp(name); + Buffer* buffer = new Buffer(name, Buffer::Flags::Fifo | Buffer::Flags::NoUndo); auto watcher = new FDWatcher(fd, [buffer](FDWatcher& watcher) {