FSF: long ago.
JWZ: some changes for Lemacs, long ago. (e.g. separate buffer
- list per frame.)
+ list per frame.)
Mly: a few changes for buffer-local vars, 19.8 or 19.9.
Ben Wing: some changes and cleanups for Mule, 19.12.
*/
(name, ignore))
{
REGISTER Lisp_Object gentemp, tem;
- int count;
+ int count, prt;
char number[23];
CHECK_STRING(name);
count = 1;
while (1) {
-
- snprintf(number, sizeof(number), "<%d>", ++count);
+ prt = snprintf(number, sizeof(number), "<%d>", ++count);
+ assert(prt>=0 && (size_t)prt < sizeof(number));
gentemp = concat2(name, build_string(number));
if (!NILP(ignore)) {
tem = Fstring_equal(gentemp, ignore);
{ int mask = XINT (buffer_local_flags.slot); \
if (mask == 0 || mask == -1 \
|| ((mask > 0) && (buf->local_var_flags & mask))) \
- result = Fcons (Fcons (syms->slot, buf->slot), result); \
+ result = Fcons (Fcons (syms->slot, buf->slot), result); \
}
#include "bufslots.h"
#undef MARKED_SLOT
(flag, buffer))
{
/* This function can GC */
- struct buffer *buf = decode_buffer(buffer, 0);
+ struct buffer *buf;
#ifdef CLASH_DETECTION
/* If buffer becoming modified, lock the file.
If buffer becoming unmodified, unlock the file. */
-
+ buf = decode_buffer(buffer, 0);
Lisp_Object fn = buf->file_truename;
if (!NILP(fn)) {
int already = BUF_SAVE_MODIFF(buf) < BUF_MODIFF(buf);
kill_specifier_buffer_locals(Fcurrent_buffer());
- changing_major_mode = 1;
+ changing_major_mode = 1;
/* Force modeline redisplay. Useful here because all major mode
commands call this function. */
Dynarr_declare(Extbyte_dynarr *);
} Extbyte_dynarr_dynarr;
-static Extbyte_dynarr_dynarr *conversion_out_dynarr_list;
-static Bufbyte_dynarr_dynarr *conversion_in_dynarr_list;
+static Extbyte_dynarr_dynarr *conversion_out_dynarr_list = NULL;
+static Bufbyte_dynarr_dynarr *conversion_in_dynarr_list = NULL;
static int dfc_convert_to_external_format_in_use;
static int dfc_convert_to_internal_format_in_use;
dfc_conversion_data * sink)
{
int count = specpdl_depth();
- Extbyte_dynarr *conversion_out_dynarr;
+ Extbyte_dynarr *conversion_out_dynarr = NULL;
type_checking_assert
(((source_type == DFC_TYPE_DATA) ||
record_unwind_protect(dfc_convert_to_external_format_reset_in_use,
make_int(dfc_convert_to_external_format_in_use));
+ assert(conversion_out_dynarr_list != NULL);
if (Dynarr_length(conversion_out_dynarr_list) <=
dfc_convert_to_external_format_in_use)
Dynarr_add(conversion_out_dynarr_list, Dynarr_new(Extbyte));
dfc_conversion_data * sink)
{
int count = specpdl_depth();
- Bufbyte_dynarr *conversion_in_dynarr;
+ Bufbyte_dynarr *conversion_in_dynarr = NULL;
type_checking_assert
((source_type == DFC_TYPE_DATA ||
record_unwind_protect(dfc_convert_to_internal_format_reset_in_use,
make_int(dfc_convert_to_internal_format_in_use));
+ assert(conversion_in_dynarr_list != NULL);
if (Dynarr_length(conversion_in_dynarr_list) <=
dfc_convert_to_internal_format_in_use)
Dynarr_add(conversion_in_dynarr_list, Dynarr_new(Bufbyte));
DEFVAR_BUFFER_LOCAL_MAGIC("tab-width", tab_width /*
*Distance between tab stops (for display of tab characters), in columns.
Automatically becomes buffer-local when set in any fashion.
- */
+ */
, redisplay_variable_changed);
DEFVAR_BUFFER_LOCAL_MAGIC("ctl-arrow", ctl_arrow /*
Automatically becomes buffer-local when set in any fashion.
This variable does not apply to characters whose display is specified
in the current display table (if there is one).
- */
+ */
, redisplay_variable_changed);
#if 0 /* #### Make this a specifier! */
Note that this is overridden by the variable
`truncate-partial-width-windows' if that variable is non-nil
and this buffer is not full-frame width.
- */
+ */
, redisplay_variable_changed);
DEFVAR_BUFFER_LOCAL("default-directory", directory /*
*/ );
#ifdef FILE_CODING
- DEFVAR_BUFFER_DEFAULTS("default-buffer-file-coding-system",
+ DEFVAR_BUFFER_DEFAULTS("default-buffer-file-coding-system",
buffer_file_coding_system /*
Default value of `buffer-file-coding-system' for buffers that do not override it.
This is the same as (default-value 'buffer-file-coding-system).
/* Is PWD another name for `.' ? */
static int directory_is_current_directory(Extbyte * pwd)
{
- Bufbyte *pwd_internal;
+ Bufbyte *pwd_internal = NULL;
Bytecount pwd_internal_len;
struct stat dotstat, pwdstat;
TO_INTERNAL_FORMAT(DATA, (pwd, strlen((char *)pwd) + 1),
ALLOCA, (pwd_internal, pwd_internal_len),
Qfile_name);
+ if( pwd_internal == NULL ) {
+ /* Failure for failure, lets try using the external
+ format anyway..
+ */
+ pwd_internal=pwd;
+ }
+ if( pwd_internal == NULL ) {
+ return 0;
+ }
return (IS_DIRECTORY_SEP(*pwd_internal)
&& sxemacs_stat((char *)pwd_internal, &pwdstat) == 0
&& sxemacs_stat(".", &dotstat) == 0
{
/* This function can GC */
- Extbyte *pwd;
+ Extbyte *pwd = NULL;
initial_directory[0] = 0;
when PWD is right, and may avoid a fatal error. */
if ((pwd = (Extbyte *) getenv("PWD")) != NULL
&& directory_is_current_directory(pwd)
- && strlen(pwd) < sizeof(initial_directory) )
- strcpy(initial_directory, (char *)pwd);
+ && strlen(pwd) < sizeof(initial_directory) )
+ strcpy(initial_directory, (char *)pwd);
else
if (getcwd(initial_directory, MAXPATHLEN) == NULL)
fatal("`getcwd' failed: %s\n", strerror(errno));