From: <enl...@li...> - 2000-11-16 23:45:04
|
Enlightenment CVS committal Author : mej Project : eterm Module : Eterm Modified Files: Makefile.am buttons.c buttons.h command.c menus.c options.c options.h pixmap.c pixmap.h screen.c startup.c startup.h system.c utmp.c Log Message: Thu Nov 16 16:40:54 PST 2000 Michael Jennings <me...@et...> VA bought some licenses for Insure++, so I've been using it to audit Eterm. These are just the initial results of the collaboration; there will most likely be more. So far things are looking pretty good. I just wish Insure++ had more helpful messages. I'd really love to be able to track down those reads/writes involving freed pointers that it claims to have found in Imlib2.... I also had to try and make the build work without MMX. I did so; I just hope it still works *with* MMX.... =) =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/Makefile.am,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- Makefile.am 2000/10/30 23:05:25 1.20 +++ Makefile.am 2000/11/16 23:45:01 1.21 @@ -1,8 +1,11 @@ -# $Id: Makefile.am,v 1.20 2000/10/30 23:05:25 mej Exp $ +# $Id: Makefile.am,v 1.21 2000/11/16 23:45:01 mej Exp $ lib_LTLIBRARIES = libEterm.la bin_PROGRAMS = Eterm +MMX_SRCS = mmx_cmod.S +MMX_OBJS = $(MMX_SRCS:.S.o) + libEterm_la_SOURCES = actions.c actions.h buttons.c buttons.h command.c \ command.h draw.c draw.h e.c e.h eterm_debug.h eterm_utmp.h \ events.c events.h feature.h font.c font.h grkelot.c \ @@ -10,14 +13,22 @@ options.c options.h pixmap.c pixmap.h profile.h screen.c \ screen.h scrollbar.c scrollbar.h startup.c startup.h \ system.c system.h term.c term.h timer.c timer.h utmp.c \ - windows.c windows.h mmx_cmod.S -libEterm_la_DEPENDENCIES = feature.h + windows.c windows.h +libEterm_la_DEPENDENCIES = feature.h $(MMX_OBJS) libEterm_la_LDFLAGS = -release $(VERSION) +libEterm_la_LDADD = $(MMX_OBJS) Eterm_SOURCES = main.c Eterm_DEPENDENCIES = libEterm.la Eterm_LDFLAGS = -rpath $(libdir):$(pkglibdir) -Eterm_LDADD = libEterm.la +Eterm_LDADD = libEterm.la + +if HAVE_MMX +$(MMX_OBJS): $(MMX_SRCS) +else +$(MMX_OBJS): + touch $(MMX_OBJS) +endif install-exec-hook: $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/buttons.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- buttons.c 2000/10/30 23:05:25 1.16 +++ buttons.c 2000/11/16 23:45:01 1.17 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: buttons.c,v 1.16 2000/10/30 23:05:25 mej Exp $"; +static const char cvs_ident[] = "$Id: buttons.c,v 1.17 2000/11/16 23:45:01 mej Exp $"; #include "config.h" #include "feature.h" @@ -109,6 +109,33 @@ } void +bbar_free(buttonbar_t *bbar) +{ + button_t *b; + + if (bbar->next) { + bbar_free(bbar->next); + } + button_free(bbar->rbuttons); + button_free(bbar->buttons); +#ifdef MULTI_CHARSET + if (bbar->fontset) { + XFreeFontSet(Xdisplay, bbar->fontset); + } +#endif + if (bbar->font) { + free_font(bbar->font); + } + if (bbar->gc != None) { + LIBAST_X_FREE_GC(bbar->gc); + } + if (bbar->win != None) { + XDestroyWindow(Xdisplay, bbar->win); + } + FREE(bbar); +} + +void bbar_init(buttonbar_t *bbar, int width) { event_register_dispatcher(bbar_dispatch_event, bbar_event_init_dispatcher); @@ -579,10 +606,28 @@ button->text = STRDUP(text); button->len = strlen(text); } else { - button->text = ""; + button->text = STRDUP(""); button->len = 0; } return button; +} + +void +button_free(button_t *button) +{ + if (button->next) { + button_free(button->next); + } + if (button->text) { + FREE(button->text); + } + if (button->type == ACTION_STRING || button->type == ACTION_ECHO) { + FREE(button->action.string); + } + if (button->icon) { + free_simage(button->icon); + } + FREE(button); } unsigned char =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/buttons.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- buttons.h 2000/09/02 04:12:16 1.4 +++ buttons.h 2000/11/16 23:45:01 1.5 @@ -96,6 +96,7 @@ _XFUNCPROTOBEGIN extern buttonbar_t *bbar_create(void); +extern void bbar_free(buttonbar_t *); extern void bbar_init(buttonbar_t *, int); extern void bbar_event_init_dispatcher(void); extern unsigned char bbar_handle_enter_notify(event_t *); @@ -116,6 +117,7 @@ extern button_t *find_button_by_text(buttonbar_t *bbar, char *text); extern button_t *find_button_by_coords(buttonbar_t *bbar, int x, int y); extern button_t *button_create(char *text); +extern void button_free(button_t *); extern unsigned char button_set_icon(button_t *button, simage_t *icon); extern unsigned char button_set_action(button_t *button, action_type_t type, char *action); extern void bbar_select_button(buttonbar_t *bbar, button_t *button); =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/command.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -3 -r1.51 -r1.52 --- command.c 2000/09/18 00:13:07 1.51 +++ command.c 2000/11/16 23:45:01 1.52 @@ -34,7 +34,7 @@ * he guarantee anything whatsoever. *----------------------------------------------------------------------*/ -static const char cvs_ident[] = "$Id: command.c,v 1.51 2000/09/18 00:13:07 mej Exp $"; +static const char cvs_ident[] = "$Id: command.c,v 1.52 2000/11/16 23:45:01 mej Exp $"; /* includes: */ #include "config.h" @@ -158,6 +158,7 @@ static Atom DndProtocol, DndSelection; #endif /* OFFIX_DND */ #ifdef USE_XIM +XIM xim_input_method = NULL; XIC xim_input_context = NULL; /* input context */ static XIMStyle xim_input_style = 0; # ifndef XSetIMValues @@ -1121,13 +1122,30 @@ { #if DEBUG >= DEBUG_MEM if (DEBUG_LEVEL >= DEBUG_MEM) { + unsigned short i; + /* Deallocate all our crap to help find memory leaks */ + selection_clear(); scr_release(); + bbar_free(buttonbar); menulist_clear(menu_list); font_cache_clear(); eterm_font_list_clear(); + FOREACH_IMAGE(free_eterm_image(&(images[idx]));); + for (i = 0; i < NRS_COLORS; i++) { + if (rs_color[i]) { + FREE(rs_color[i]); + } + } + conf_free_subsystem(); } #endif +#ifdef USE_XIM + if (xim_input_method) { + XCloseIM(xim_input_method); + } +#endif + XCloseDisplay(Xdisplay); privileges(INVOKE); @@ -1744,11 +1762,6 @@ if (locale == NULL) { print_error("Setting locale failed.\n"); } else { -#ifdef MULTI_CHARSET - TermWin.fontset = create_fontset(etfonts[def_font_idx], etmfonts[def_font_idx]); -#else - TermWin.fontset = create_fontset(etfonts[def_font_idx], "-misc-fixed-medium-r-semicondensed--13-*-75-*-c-*-iso10646-1"); -#endif #ifdef USE_XIM # ifdef MULTI_CHARSET if (strcmp(locale, "C")) @@ -1763,6 +1776,13 @@ # endif } #endif +#ifdef MULTI_CHARSET + TermWin.fontset = create_fontset(etfonts[def_font_idx], etmfonts[def_font_idx]); +#else + TermWin.fontset = create_fontset(etfonts[def_font_idx], "-misc-fixed-medium-r-semicondensed--13-*-75-*-c-*-iso10646-1"); +#endif + /* Reset locale to NULL since the call to create_fontset() has freed that memory. */ + locale = NULL; } } #endif /* USE_XIM || MULTI_CHARSET */ @@ -1829,6 +1849,7 @@ xim_destroy_cb(XIM xim, XPointer client_data, XPointer call_data) { xim_input_context = NULL; + xim_input_method = NULL; XRegisterIMInstantiateCallback(Xdisplay, NULL, NULL, NULL, xim_instantiate_cb, NULL); xim = NULL; client_data = call_data = (XPointer) 0; @@ -1851,7 +1872,6 @@ { char *p, *s, buf[64], tmp[1024]; char *end, *next_s; - XIM xim = NULL; XIMStyles *xim_styles = NULL; int found; XPoint spot; @@ -1876,7 +1896,7 @@ *(end + 1) = '\0'; if (*s) { snprintf(buf, sizeof(buf), "@im=%s", s); - if (((p = XSetLocaleModifiers(buf)) != NULL) && (*p) && ((xim = XOpenIM(Xdisplay, NULL, NULL, NULL)) != NULL)) { + if (((p = XSetLocaleModifiers(buf)) != NULL) && (*p) && ((xim_input_method = XOpenIM(Xdisplay, NULL, NULL, NULL)) != NULL)) { break; } } @@ -1887,20 +1907,20 @@ } /* try with XMODIFIERS env. var. */ - if (xim == NULL && getenv("XMODIFIERS") && (p = XSetLocaleModifiers("")) != NULL && *p) { - xim = XOpenIM(Xdisplay, NULL, NULL, NULL); + if (xim_input_method == NULL && getenv("XMODIFIERS") && (p = XSetLocaleModifiers("")) != NULL && *p) { + xim_input_method = XOpenIM(Xdisplay, NULL, NULL, NULL); } /* try with no modifiers base */ - if (xim == NULL && (p = XSetLocaleModifiers("@im=none")) != NULL && *p) { - xim = XOpenIM(Xdisplay, NULL, NULL, NULL); + if (xim_input_method == NULL && (p = XSetLocaleModifiers("@im=none")) != NULL && *p) { + xim_input_method = XOpenIM(Xdisplay, NULL, NULL, NULL); } - if (xim == NULL) { - xim = XOpenIM(Xdisplay, NULL, NULL, NULL); + if (xim_input_method == NULL) { + xim_input_method = XOpenIM(Xdisplay, NULL, NULL, NULL); } - if (xim == NULL) { + if (xim_input_method == NULL) { return -1; } @@ -1910,15 +1930,15 @@ destroy_cb.callback = xim_destroy_cb; destroy_cb.client_data = NULL; - if (XSetIMValues(xim, XNDestroyCallback, &destroy_cb, NULL)) { + if (XSetIMValues(xim_input_method, XNDestroyCallback, &destroy_cb, NULL)) { print_error("Could not set destroy callback to IM\n"); } } #endif - if ((XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL)) || (!xim_styles)) { + if ((XGetIMValues(xim_input_method, XNQueryInputStyle, &xim_styles, NULL)) || (!xim_styles)) { print_error("input method doesn't support any style\n"); - XCloseIM(xim); + XCloseIM(xim_input_method); return -1; } strncpy(tmp, (rs_preedit_type ? rs_preedit_type : "OverTheSpot,OffTheSpot,Root"), sizeof(tmp) - 1); @@ -1952,14 +1972,14 @@ if (found == 0) { print_error("input method doesn't support my preedit type\n"); - XCloseIM(xim); + XCloseIM(xim_input_method); return -1; } if ((xim_input_style != (XIMPreeditNothing | XIMStatusNothing)) && (xim_input_style != (XIMPreeditArea | XIMStatusArea)) && (xim_input_style != (XIMPreeditPosition | XIMStatusNothing))) { print_error("This program does not support the preedit type\n"); - XCloseIM(xim); + XCloseIM(xim_input_method); return -1; } if (xim_input_style & XIMPreeditPosition) { @@ -1975,7 +1995,7 @@ preedit_attr = XVaCreateNestedList(0, XNArea, &rect, XNForeground, fg, XNBackground, bg, XNFontSet, TermWin.fontset, NULL); status_attr = XVaCreateNestedList(0, XNArea, &status_rect, XNForeground, fg, XNBackground, bg, XNFontSet, TermWin.fontset, NULL); } - xim_input_context = XCreateIC(xim, XNInputStyle, xim_input_style, XNClientWindow, TermWin.parent, XNFocusWindow, TermWin.parent, + xim_input_context = XCreateIC(xim_input_method, XNInputStyle, xim_input_style, XNClientWindow, TermWin.parent, XNFocusWindow, TermWin.parent, preedit_attr ? XNPreeditAttributes : NULL, preedit_attr, status_attr ? XNStatusAttributes : NULL, status_attr, NULL); if (preedit_attr) { XFree(preedit_attr); @@ -1985,7 +2005,7 @@ } if (xim_input_context == NULL) { print_error("Failed to create input context\n"); - XCloseIM(xim); + XCloseIM(xim_input_method); return -1; } if (xim_input_style & XIMPreeditArea) @@ -2055,7 +2075,7 @@ * the slave. */ int -run_command(char *argv[]) +run_command(char **argv) { ttymode_t tio; @@ -2226,7 +2246,7 @@ /* init_command() */ void -init_command(char *argv[]) +init_command(char **argv) { /* Initialize the command connection. This should be called after =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/menus.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -3 -r1.40 -r1.41 --- menus.c 2000/10/30 23:05:25 1.40 +++ menus.c 2000/11/16 23:45:01 1.41 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: menus.c,v 1.40 2000/10/30 23:05:25 mej Exp $"; +static const char cvs_ident[] = "$Id: menus.c,v 1.41 2000/11/16 23:45:01 mej Exp $"; #include "config.h" #include "feature.h" @@ -476,6 +476,7 @@ ASSERT(menu != NULL); + D_MENU(("Deleting menu \"%s\"\n", menu->title)); for (i = 0; i < menu->numitems; i++) { menuitem_delete(menu->items[i]); } @@ -497,11 +498,11 @@ if (menu->font) { free_font(menu->font); } - if (menu->win) { - XDestroyWindow(Xdisplay, menu->win); - } if (menu->swin) { XDestroyWindow(Xdisplay, menu->swin); + } + if (menu->win) { + XDestroyWindow(Xdisplay, menu->win); } FREE(menu); } =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/options.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -3 -r1.75 -r1.76 --- options.c 2000/11/15 01:30:02 1.75 +++ options.c 2000/11/16 23:45:01 1.76 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: options.c,v 1.75 2000/11/15 01:30:02 mej Exp $"; +static const char cvs_ident[] = "$Id: options.c,v 1.76 2000/11/16 23:45:01 mej Exp $"; #include "config.h" #include "feature.h" @@ -1164,7 +1164,7 @@ ctx_idx = 0; context = (ctx_t *) MALLOC(sizeof(ctx_t) * ctx_cnt); MEMSET(context, 0, sizeof(ctx_t) * ctx_cnt); - context[0].name = "null"; + context[0].name = STRDUP("null"); context[0].handler = parse_null; /* Initialize the context state stack and set the current context to "null" */ @@ -1265,6 +1265,29 @@ ctx_state[ctx_state_idx].ctx_id = ctx_id; ctx_state[ctx_state_idx].state = NULL; return (ctx_state_idx); +} + +void +conf_free_subsystem(void) +{ + conf_var_t *v, *tmp; + unsigned long i; + + for (v = conf_vars; v;) { + tmp = v; + v = v->next; + conf_free_var(tmp); + } + for (i = 0; i < builtin_idx; i++) { + FREE(builtins[i].name); + } + for (i = 0; i <= ctx_idx; i++) { + FREE(context[i].name); + } + FREE(ctx_state); + FREE(builtins); + FREE(fstate); + FREE(context); } static conf_var_t * =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/options.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- options.h 2000/11/15 01:30:02 1.25 +++ options.h 2000/11/16 23:45:01 1.26 @@ -259,6 +259,7 @@ extern unsigned char conf_register_fstate(FILE *fp, char *path, char *outfile, unsigned long line, unsigned char flags); extern unsigned char conf_register_builtin(char *name, eterm_func_ptr_t ptr); extern unsigned char conf_register_context_state(unsigned char ctx_id); +extern void conf_free_subsystem(void); extern char *chomp(char *); extern char *shell_expand(char *); extern char *conf_find_file(const char *file, const char *dir, const char *pathlist); =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/pixmap.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -3 -r1.59 -r1.60 --- pixmap.c 2000/11/10 04:16:41 1.59 +++ pixmap.c 2000/11/16 23:45:01 1.60 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: pixmap.c,v 1.59 2000/11/10 04:16:41 mej Exp $"; +static const char cvs_ident[] = "$Id: pixmap.c,v 1.60 2000/11/16 23:45:01 mej Exp $"; #include "config.h" #include "feature.h" @@ -327,7 +327,12 @@ if (img->disabled) { free_simage(img->disabled); } +#if 0 + /* FIXME: There should really be an option to specify whether or not + to free the image itself, but since we never MALLOC() an entire + image_t, it's not really needed at this point. And I'm lazy. :-) */ FREE(img); +#endif } simage_t * @@ -366,19 +371,40 @@ FREE(simg->iml->border); simg->iml->border = NULL; } + if ((mask & RESET_IMLIB_BEVEL) && simg->iml->bevel) { + FREE(simg->iml->bevel->edges); + FREE(simg->iml->bevel); + simg->iml->bevel = NULL; + } + if ((mask & RESET_IMLIB_PAD) && simg->iml->pad) { + FREE(simg->iml->pad); + simg->iml->pad = NULL; + } if ((mask & RESET_IMLIB_MOD) && simg->iml->mod) { FREE(simg->iml->mod); simg->iml->mod = NULL; } if ((mask & RESET_IMLIB_RMOD) && simg->iml->rmod) { + if (simg->iml->rmod->imlib_mod) { + imlib_context_set_color_modifier(simg->iml->rmod->imlib_mod); + imlib_free_color_modifier(); + } FREE(simg->iml->rmod); simg->iml->rmod = NULL; } if ((mask & RESET_IMLIB_GMOD) && simg->iml->gmod) { + if (simg->iml->gmod->imlib_mod) { + imlib_context_set_color_modifier(simg->iml->gmod->imlib_mod); + imlib_free_color_modifier(); + } FREE(simg->iml->gmod); simg->iml->gmod = NULL; } if ((mask & RESET_IMLIB_BMOD) && simg->iml->bmod) { + if (simg->iml->bmod->imlib_mod) { + imlib_context_set_color_modifier(simg->iml->bmod->imlib_mod); + imlib_free_color_modifier(); + } FREE(simg->iml->bmod); simg->iml->bmod = NULL; } @@ -395,6 +421,8 @@ free_simage(simage_t *s) { reset_simage(s, RESET_ALL_SIMG); + FREE(s->iml); + FREE(s->pmap); FREE(s); } =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/pixmap.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -3 -r1.34 -r1.35 --- pixmap.h 2000/10/30 23:05:25 1.34 +++ pixmap.h 2000/11/16 23:45:01 1.35 @@ -143,18 +143,20 @@ #define RESET_ALL_TINT (RESET_IMLIB_RMOD | RESET_IMLIB_GMOD | RESET_IMLIB_BMOD) #define RESET_ALL_MOD (RESET_IMLIB_MOD | RESET_IMLIB_RMOD | RESET_IMLIB_GMOD | RESET_IMLIB_BMOD) #define RESET_IMLIB_BORDER (1UL << 4) -#define RESET_IMLIB_IM (1UL << 5) -#define RESET_ALL_IMLIB (RESET_ALL_MOD | RESET_IMLIB_BORDER | RESET_IMLIB_IM) -#define RESET_PMAP_GEOM (1UL << 6) -#define RESET_PMAP_PIXMAP (1UL << 7) -#define RESET_PMAP_MASK (1UL << 8) +#define RESET_IMLIB_BEVEL (1UL << 5) +#define RESET_IMLIB_PAD (1UL << 6) +#define RESET_IMLIB_IM (1UL << 7) +#define RESET_ALL_IMLIB (RESET_ALL_MOD | RESET_IMLIB_BORDER | RESET_IMLIB_BEVEL | RESET_IMLIB_PAD | RESET_IMLIB_IM) +#define RESET_PMAP_GEOM (1UL << 8) +#define RESET_PMAP_PIXMAP (1UL << 9) +#define RESET_PMAP_MASK (1UL << 10) #define RESET_ALL_PMAP (RESET_PMAP_GEOM | RESET_PMAP_PIXMAP | RESET_PMAP_MASK) #define RESET_ALL_SIMG (RESET_ALL_IMLIB | RESET_ALL_PMAP) -#define RESET_NORM (1UL << 9) -#define RESET_SELECTED (1UL << 10) -#define RESET_CLICKED (1UL << 11) -#define RESET_DISABLED (1UL << 12) -#define RESET_MODE (1UL << 13) +#define RESET_NORM (1UL << 11) +#define RESET_SELECTED (1UL << 12) +#define RESET_CLICKED (1UL << 13) +#define RESET_DISABLED (1UL << 14) +#define RESET_MODE (1UL << 15) #define RESET_ALL (RESET_NORM | RESET_SELECTED | RESET_CLICKED | RESET_DISABLED | RESET_MODE) /************ Structures ************/ =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/screen.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -3 -r1.50 -r1.51 --- screen.c 2000/11/15 22:21:02 1.50 +++ screen.c 2000/11/16 23:45:01 1.51 @@ -3,7 +3,7 @@ * */ -static const char cvs_ident[] = "$Id: screen.c,v 1.50 2000/11/15 22:21:02 mej Exp $"; +static const char cvs_ident[] = "$Id: screen.c,v 1.51 2000/11/16 23:45:01 mej Exp $"; #include "config.h" #include "feature.h" @@ -302,7 +302,7 @@ if (tabs) FREE(tabs); } - tabs = MALLOC(TermWin.ncol * sizeof(char)); + tabs = MALLOC(TermWin.ncol); for (i = 0; i < TermWin.ncol; i++) tabs[i] = (i % TABSIZE == 0) ? 1 : 0; @@ -2163,7 +2163,7 @@ for (row = 0; row < rows; row++) { if (screen.text[row]) { c = screen.text[row]; - for (s = strstr(c, str); s; s = strstr(++s, str)) { + for (s = strstr(c, str); s; s = strstr(s + 1, str)) { unsigned long j; col = (int) s - (int) c; @@ -3089,13 +3089,13 @@ } } #ifdef MULTI_CHARSET - if (selection.beg.col > 0) { + if ((selection.beg.col > 0) && (selection.beg.col < TermWin.ncol)) { r = selection.beg.row + TermWin.saveLines; if (((screen.rend[r][selection.beg.col] & RS_multiMask) == RS_multi2) && ((screen.rend[r][selection.beg.col - 1] & RS_multiMask) == RS_multi1)) selection.beg.col--; } - if (selection.end.col < TermWin.ncol - 1) { + if ((selection.end.col > 0) && (selection.end.col < (TermWin.ncol - 1))) { r = selection.end.row + TermWin.saveLines; if (((screen.rend[r][selection.end.col] & RS_multiMask) == RS_multi1) && ((screen.rend[r][selection.end.col + 1] & RS_multiMask) == RS_multi2)) =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/startup.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -3 -r1.23 -r1.24 --- startup.c 2000/11/15 01:30:02 1.23 +++ startup.c 2000/11/16 23:45:01 1.24 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: startup.c,v 1.23 2000/11/15 01:30:02 mej Exp $"; +static const char cvs_ident[] = "$Id: startup.c,v 1.24 2000/11/16 23:45:01 mej Exp $"; #include "config.h" #include "feature.h" @@ -64,7 +64,7 @@ TermWin_t TermWin; Display *Xdisplay; /* display */ Colormap cmap; -const char *display_name = NULL; +char *display_name = NULL; unsigned int colorfgbg; int @@ -92,8 +92,11 @@ libast_set_program_version(VERSION); /* Open display, get options/resources and create the window */ - if ((display_name = getenv("DISPLAY")) == NULL) - display_name = ":0"; + if (getenv("DISPLAY") == NULL) { + display_name = STRDUP(":0"); + } else { + display_name = STRDUP(getenv("DISPLAY")); + } /* This MUST be called before any other Xlib functions */ =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/startup.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- startup.h 2000/03/15 03:17:45 1.9 +++ startup.h 2000/11/16 23:45:01 1.10 @@ -134,7 +134,7 @@ #ifdef PIXMAP_SUPPORT extern short bg_needs_update; #endif -extern const char *display_name; +extern char *display_name; /************ Function Prototypes ************/ _XFUNCPROTOBEGIN =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/system.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- system.c 2000/08/31 05:41:44 1.11 +++ system.c 2000/11/16 23:45:01 1.12 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: system.c,v 1.11 2000/08/31 05:41:44 mej Exp $"; +static const char cvs_ident[] = "$Id: system.c,v 1.12 2000/11/16 23:45:01 mej Exp $"; #include "../config.h" #include "feature.h" @@ -98,6 +98,7 @@ D_OPTIONS(("%d: fork() returned %d\n", getpid(), pid)); return (wait_for_chld(pid)); } + ASSERT_NOTREACHED_RVAL(0); } int =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/utmp.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- utmp.c 2000/09/01 22:14:17 1.8 +++ utmp.c 2000/11/16 23:45:01 1.9 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: utmp.c,v 1.8 2000/09/01 22:14:17 mej Exp $"; +static const char cvs_ident[] = "$Id: utmp.c,v 1.9 2000/11/16 23:45:01 mej Exp $"; #include "config.h" #include "feature.h" @@ -142,16 +142,13 @@ add_utmp_entry(const char *pty, const char *hostname, int fd) { struct passwd *pwent = getpwuid(my_ruid); - # ifdef HAVE_UTMPX_H struct utmpx utmp; struct utmp utmp2; MEMSET(&utmp, 0, sizeof(struct utmpx)); - # else struct utmp utmp; MEMSET(&utmp, 0, sizeof(struct utmp)); - # endif # ifdef WITH_DMALLOC |