diff --git a/src/backend_firefox.c b/src/backend_firefox.c index c97b47b..5666d86 100644 --- a/src/backend_firefox.c +++ b/src/backend_firefox.c @@ -398,9 +398,8 @@ bookmark_do_create ( stat_buf->value_len = -1; int64_t place_id = 0; if (!is_dir) { - char const *url = "about:blank"; - stat_buf->value_len = strlen(url); - status = mozplace_addref(ctx, url, stat_buf->value_len, &place_id, + stat_buf->value_len = 0; + status = mozplace_addref(ctx, STR_WITHLEN("about:blank"), &place_id, &stat_buf->atime); if (status < 0) { return status; diff --git a/src/fs_ops.c b/src/fs_ops.c index b88eb13..11791c2 100644 --- a/src/fs_ops.c +++ b/src/fs_ops.c @@ -409,6 +409,12 @@ bm_create ( } } + if (flags & O_TRUNC) { + // See bm_open() for comments on O_RDONLY|O_TRUNC. + if ((flags & O_ACCMODE) != O_RDONLY) { + stat.value_len = 0; + } + } bm_fillstat(&stat, SUBSYS_TYPE_BOOKMARK, false, stat_buf); return 0; }