sleepy_penguin RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [ANN] sleepy_penguin 3.4.1 - minor updates
@ 2015-01-11  8:15  5% Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-01-11  8:15 UTC (permalink / raw)
  To: sleepy-penguin

Most notably the mailing list is now subscription-optional
on the bogomips.org server:

    sleepy-penguin@bogomips.org

If you want to keep receiving email updates, you'll need to
resubscribe by sending a message to:

    sleepy-penguin+subscribe@bogomips.org

Migrating subscribers can't be done automatically as librelist
(our old host) doesn't publish subscriber lists.  But you don't
have to subscribe, either, HTTP archives are available at:

    http://bogomips.org/sleepy-penguin/

There you'll also find links to ssoma/public-inbox for
extracting the mail archives to git.

shortlog:
      test_kqueue_io: add test for deleting items
      test_inotify: add test for rm_watch
      extconf: detect inotify_init1 in libc
      inotify: cleanup Inotify::Event creation
      switch documentation to olddoc
      change mailing list to sleepy-penguin@bogomips.org
      relax license to LGPLv2.1+ (from v2.1 && v3 only)
      cleanup documentation links and ignores
      gemspec: add dev dependency on test-unit 3.x
      README: label the link to the mailing list archives
      GNUmakefile: drop more RubyForge references
      README: stop mentioning Rubinius
      gemspec: use minitest, not test-unit

Note: I pushed a 3.4.0 commit but yanked the corresponding
tag since I screwed up the gemspec (fixed in
commit 304bb9021363e06667985daf36c1cfa6df0176a3
"gemspec: remove dead rdoc_options config")

-- 
EW

^ permalink raw reply	[relevance 5%]

* [sleepy.penguin] [PATCH] inotify: cleanup Inotify::Event creation
  @ 2014-12-28  2:27  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2014-12-28  2:27 UTC (permalink / raw)
  To: sleepy.penguin

We'll prefer using rb_str_new2 instead of rb_str_new(...,strlen)
to save binary size.  While we're at it, explain why we cannot
take e->len into account for plain-old rb_str_new.
---
 ext/sleepy_penguin/inotify.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/ext/sleepy_penguin/inotify.c b/ext/sleepy_penguin/inotify.c
index 1f2d4ac..b324227 100644
--- a/ext/sleepy_penguin/inotify.c
+++ b/ext/sleepy_penguin/inotify.c
@@ -124,8 +124,13 @@ static VALUE event_new(struct inotify_event *e)
 	VALUE cookie = UINT2NUM(e->cookie);
 	VALUE name;
 
-	/* name may be zero-padded, so we do strlen() */
-	name = e->len ? rb_str_new(e->name, strlen(e->name)) : Qnil;
+	/*
+	 * e->name is zero-padded, so we may use rb_str_new2.
+	 * We do not use rb_str_new(e->name, e->len) because
+	 * e->len counts all \0 padding bytes, and there may be
+	 * multiple padding bytes
+	 */
+	name = e->len ? rb_str_new2(e->name) : Qnil;
 
 	return rb_struct_new(cEvent, wd, mask, cookie, name);
 }
-- 
EW



^ permalink raw reply related	[relevance 7%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2014-12-28  2:27     [sleepy.penguin] [PATCH] extconf: detect inotify_init1 in libc Eric Wong
2014-12-28  2:27  7% ` [sleepy.penguin] [PATCH] inotify: cleanup Inotify::Event creation Eric Wong
2015-01-11  8:15  5% [ANN] sleepy_penguin 3.4.1 - minor updates Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/sleepy_penguin.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).