aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-07-10 11:59:31 +0400
committerDmitry Antipov2012-07-10 11:59:31 +0400
commitcb1caeaf2ba26df05e8f9bcd4aa63203cef781fb (patch)
tree78cbdfcc89455a0ab097eb1fd16c029d0ac48e0d /src/buffer.c
parentd02eb359e68a083fc55f0355b86df2a07b8d570d (diff)
downloademacs-cb1caeaf2ba26df05e8f9bcd4aa63203cef781fb.tar.gz
emacs-cb1caeaf2ba26df05e8f9bcd4aa63203cef781fb.zip
Avoid calls to strlen in miscellaneous functions.
* buffer.c (init_buffer): Use precalculated len, adjust if needed. * font.c (Ffont_xlfd_name): Likewise. Change to call make_string. * lread.c (openp): Likewise.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 28cede3916c..4999639128d 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5091,9 +5091,10 @@ init_buffer (void)
5091 fatal ("`get_current_dir_name' failed: %s\n", strerror (errno)); 5091 fatal ("`get_current_dir_name' failed: %s\n", strerror (errno));
5092 pwd[len] = DIRECTORY_SEP; 5092 pwd[len] = DIRECTORY_SEP;
5093 pwd[len + 1] = '\0'; 5093 pwd[len + 1] = '\0';
5094 len++;
5094 } 5095 }
5095 5096
5096 BVAR (current_buffer, directory) = make_unibyte_string (pwd, strlen (pwd)); 5097 BVAR (current_buffer, directory) = make_unibyte_string (pwd, len);
5097 if (! NILP (BVAR (&buffer_defaults, enable_multibyte_characters))) 5098 if (! NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))
5098 /* At this moment, we still don't know how to decode the 5099 /* At this moment, we still don't know how to decode the
5099 directory name. So, we keep the bytes in multibyte form so 5100 directory name. So, we keep the bytes in multibyte form so