richterm

"terminal emulator" with support for text fonts and images for plan9
git clone git://nsmpr.xyz/richterm.git
Log | Files | Refs | README

commit da92096a6428e5e69a03945237ead35d062529fc
parent d4c7e5d3263b880b60002ec2ef5db33346f7ef1a
Author: Pavel Renev <an2qzavok@gmail.com>
Date:   Tue, 24 Aug 2021 11:36:02 +0000

fix fs_open being triggered on root

Diffstat:
MTODO | 5-----
Mfs.c | 19+++++++++++--------
2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/TODO b/TODO @@ -10,7 +10,3 @@ draw them # links highlight them and add 3-button menu for interacting with them - -# catch ghost new file creation events - -probably related to new file being read by ls? -\ No newline at end of file diff --git a/fs.c b/fs.c @@ -94,18 +94,21 @@ void fs_open(Req *r) { Fsctl *fsctl; + File *f; fsctl = new->aux; + f = r->fid->file; + if (f == new) { + newobj = objectcreate(); + mkobjectftree(newobj, fsctl->tree->root); + objinsertbeforelast(newobj); - newobj = objectcreate(); - mkobjectftree(newobj, fsctl->tree->root); - objinsertbeforelast(newobj); - - /* - * Because our newobj is created empty, there's no need - * to move text from olast around. - */ + /* + * Because our newobj is created empty, there's no need + * to move text from olast around. + */ + } respond(r, nil);