From e946a9acf6e12137caf836fc043d695c65684110 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Mon, 12 Jan 2015 20:14:43 +0300 Subject: [PATCH] Miscellaneous tiny fixes here and there. * fileio.c (Ffile_name_as_directory, Fdirectory_file_name): Remove dead NILP check. * image.c (Flookup_image): Use regular format for docstring. * keyboard.c (apply_modifiers_uncached): Use stpcpy. --- src/ChangeLog | 7 +++++++ src/fileio.c | 5 ----- src/image.c | 3 ++- src/keyboard.c | 8 ++++---- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index ea6274f11f1..32f17e1a863 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2015-01-12 Dmitry Antipov + + * fileio.c (Ffile_name_as_directory, Fdirectory_file_name): + Remove dead NILP check. + * image.c (Flookup_image): Use regular format for docstring. + * keyboard.c (apply_modifiers_uncached): Use stpcpy. + 2015-01-12 Martin Rudalics * dispnew.c (change_frame_size_1): Pass Qchange_frame_size to diff --git a/src/fileio.c b/src/fileio.c index 15c6f9123a2..cd3c485da0f 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -522,8 +522,6 @@ For a Unix-syntax file name, just appends a slash. */) USE_SAFE_ALLOCA; CHECK_STRING (file); - if (NILP (file)) - return Qnil; /* If the file name has special constructs in it, call the corresponding file handler. */ @@ -591,9 +589,6 @@ In Unix-syntax, this function just removes the final slash. */) CHECK_STRING (directory); - if (NILP (directory)) - return Qnil; - /* If the file name has special constructs in it, call the corresponding file handler. */ handler = Ffind_file_name_handler (directory, Qdirectory_file_name); diff --git a/src/image.c b/src/image.c index 5d08a890234..9c09c5596b9 100644 --- a/src/image.c +++ b/src/image.c @@ -9288,7 +9288,8 @@ DEFUN ("imagep", Fimagep, Simagep, 1, 1, 0, } -DEFUN ("lookup-image", Flookup_image, Slookup_image, 1, 1, 0, "") +DEFUN ("lookup-image", Flookup_image, Slookup_image, 1, 1, 0, + doc: /* */) (Lisp_Object spec) { ptrdiff_t id = -1; diff --git a/src/keyboard.c b/src/keyboard.c index 5411afff482..9d6eb07a181 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -6270,10 +6270,10 @@ apply_modifiers_uncached (int modifiers, char *base, int base_len, int base_len_ if (modifiers & meta_modifier) { *p++ = 'M'; *p++ = '-'; } if (modifiers & shift_modifier) { *p++ = 'S'; *p++ = '-'; } if (modifiers & super_modifier) { *p++ = 's'; *p++ = '-'; } - if (modifiers & double_modifier) { strcpy (p, "double-"); p += 7; } - if (modifiers & triple_modifier) { strcpy (p, "triple-"); p += 7; } - if (modifiers & down_modifier) { strcpy (p, "down-"); p += 5; } - if (modifiers & drag_modifier) { strcpy (p, "drag-"); p += 5; } + if (modifiers & double_modifier) p = stpcpy (p, "double-"); + if (modifiers & triple_modifier) p = stpcpy (p, "triple-"); + if (modifiers & down_modifier) p = stpcpy (p, "down-"); + if (modifiers & drag_modifier) p = stpcpy (p, "drag-"); /* The click modifier is denoted by the absence of other modifiers. */ *p = '\0'; -- 2.39.2