From d983ccb3c58fd2e498bcf27b8c23d368d17e4513 Mon Sep 17 00:00:00 2001 From: Michael Jennings Date: Tue, 15 Mar 2005 21:48:14 +0000 Subject: [PATCH] Tue Mar 15 16:44:09 2005 Michael Jennings (mej) Reverted part of a patch from Chris Schoeneman (changelog entry "Fri Jun 25 17:48:24 2004") which broke dead keys and compose-key sequences. Fixed autoSHIT for dist/distcheck/distclean/maintainer-clean and newer autoSHIT versions. Fixed error in saving of cut_chars attribute. Fixed saving/handling of beep_command attribute. ---------------------------------------------------------------------- SVN revision: 13745 --- ChangeLog | 13 +++++++++++++ Makefile.am | 2 ++ bg/Makefile.am | 1 + configure.in | 4 ++-- doc/Makefile.am | 8 ++++++-- pix/Makefile.am | 4 ++++ src/Makefile.am | 1 + src/misc.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++ src/misc.h | 1 + src/options.c | 20 ++++++++++++++++++-- src/screen.c | 2 +- src/windows.c | 4 +--- themes/Makefile.am | 4 ++++ utils/Makefile.am | 2 ++ 14 files changed, 103 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf8261a..69c690f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5300,3 +5300,16 @@ Merged in previous autoFUCK changes from libast. Added a feature to specify a command to be run in place of the normal PC speaker beep. ---------------------------------------------------------------------- +Tue Mar 15 16:44:09 2005 Michael Jennings (mej) + +Reverted part of a patch from Chris Schoeneman +(changelog entry "Fri Jun 25 17:48:24 2004") which broke dead keys and +compose-key sequences. + +Fixed autoSHIT for dist/distcheck/distclean/maintainer-clean and newer +autoSHIT versions. + +Fixed error in saving of cut_chars attribute. + +Fixed saving/handling of beep_command attribute. +---------------------------------------------------------------------- diff --git a/Makefile.am b/Makefile.am index 8a2fee4..2419f2b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,3 +5,5 @@ AUTOMAKE_OPTIONS = foreign SUBDIRS = src themes utils doc bg pix EXTRA_DIST = README ReleaseNotes ReleaseNotes.1 CVS-README ChangeLog autogen.sh Eterm.spec +MAINTAINERCLEANFILES = Makefile.in *~ aclocal.m4 config.guess config.sub configure depcomp \ + install-sh ltconfig ltmain.sh missing mkinstalldirs stamp-h* *.log config.h.in diff --git a/bg/Makefile.am b/bg/Makefile.am index 12d0bfc..a8a5369 100644 --- a/bg/Makefile.am +++ b/bg/Makefile.am @@ -16,3 +16,4 @@ install-data-hook: done) ; \ done) $(UPDATE_SCRIPT) $(DESTDIR)${pixmapdir} +MAINTAINERCLEANFILES=Makefile.in diff --git a/configure.in b/configure.in index 6ea1465..0e45ded 100644 --- a/configure.in +++ b/configure.in @@ -1011,7 +1011,7 @@ for i in utils/kEsetroot themes/Eterm/theme.cfg themes/auto/theme.cfg themes/Esc } else { print $0; } - }' $srcdir/$i.in > $srcdir/$i + }' $i.in > $i done &% changequote([, ])dnl @@ -1029,7 +1029,7 @@ Configuration: Source code location: $srcdir Host System Type: $host - Preprocessor: $CC $CPPFLAGS + Preprocessor: $CPP $CPPFLAGS Compiler: $CC $CFLAGS Linker: $CC $LDFLAGS $LIBS Install path: $prefix diff --git a/doc/Makefile.am b/doc/Makefile.am index 354add5..dd00f4e 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -10,15 +10,19 @@ Eterm.1: $(top_srcdir)/doc/Eterm.1.in Eterm.1.html: Eterm.1 (nroff -man $< | man2html -title Eterm > $@) || : -install-data-hook: - $(TIC) Eterm.ti || (mkinstalldirs $(HOME)/.terminfo && $(TIC) -o$(HOME)/.terminfo Eterm.ti) || : +Eterm.tcap: Eterm.ti -(infocmp -C -sc Eterm | sed -e '/Reconstructed/d' -e '/\.\.sa=/d' \ -e 's!^\([[:space:]]:co#.*\):\\$$!\1:pa#64:Co#8:AF=\\E[3%dm:AB=\\E[4%dm:op=\\E[39m\\E[49m:\\!' \ -e 's!:$$!:\\!' ; echo ' :ac=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~:' \ ) > Eterm.tcap.new && mv Eterm.tcap.new Eterm.tcap || rm -f Eterm.tcap.new + +install-data-hook: + $(TIC) Eterm.ti || (mkinstalldirs $(HOME)/.terminfo && $(TIC) -o$(HOME)/.terminfo Eterm.ti) || : -if test -f /usr/share/misc/termcap && test -f Eterm.tcap ; then \ grep -i 'Eterm Terminal Emulator' /usr/share/misc/termcap || cat Eterm.tcap >> /usr/share/misc/termcap ; \ cap_mkdb termcap ; \ fi || : +DISTCLEANFILES = Eterm.1 Eterm.1.html Eterm.tcap EXTRA_DIST = Eterm.1.in Eterm_reference.html Eterm.tcap Eterm.ti README.Escreen Makefile.am Makefile.in +MAINTAINERCLEANFILES=Makefile.in diff --git a/pix/Makefile.am b/pix/Makefile.am index 289c23f..899e671 100644 --- a/pix/Makefile.am +++ b/pix/Makefile.am @@ -13,3 +13,7 @@ install-data-hook: echo $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)${pixmapdir} ; \ $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)${pixmapdir} ; \ done + +uninstall-hook: + rm -rf $(DESTDIR)$(pkgdatadir)/pix +MAINTAINERCLEANFILES=Makefile.in diff --git a/src/Makefile.am b/src/Makefile.am index 3e9faf1..84353df 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -36,3 +36,4 @@ EXTRA_DIST = mmx_cmod.S install-exec-hook: $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) test ! -z "$(GDB_CMD_FILE)" && $(INSTALL_DATA) gdb.scr $(DESTDIR)$(pkgdatadir)/ || : +MAINTAINERCLEANFILES=Makefile.in diff --git a/src/misc.c b/src/misc.c index 1d4034d..577fd73 100644 --- a/src/misc.c +++ b/src/misc.c @@ -223,6 +223,53 @@ parse_escaped_string(char *str) return (pnew - str); } +spif_charptr_t +escape_string(spif_charptr_t str, spif_char_t quote, spif_int32_t maxlen) +{ + spif_charptr_t buff, s = str, pbuff; + + D_STRINGS(("escape_string(%s %c %ld)\n", (char *) str, quote, maxlen)); + if (! quote) { + quote = '\"'; + } + + /* The escaped string will be at most twice the length of the original. */ + buff = SPIF_CAST(charptr) MALLOC(strlen(SPIF_CAST_PTR(char) str) * 2 + 1); + + /* Copy and escape the string from str into buff. */ + for (pbuff = buff; (*s); s++, pbuff++) { + if (*s == quote) { + D_STRINGS(("Double-escaping \'%c\' at position %d\n", *s, s - str)); + *pbuff = '\\'; + pbuff++; + *pbuff = '\\'; + pbuff++; + } else { + if (quote == '\"') { + if ((*s == '\\') || (*s == '`')) { + D_STRINGS(("Escaping \'%c\' at position %d\n", *s, s - str)); + *pbuff = '\\'; + pbuff++; + } + } + } + D_STRINGS(("Copying \'%c\' at position %d\n", *s, s - str)); + *pbuff = *s; + } + *pbuff = 0; + + if (maxlen) { + /* Given maxlen, we know "str" can hold at least "maxlen" chars. */ + if (!spiftool_safe_strncpy(str, buff, maxlen)) { + str[maxlen] = 0; + } + FREE(buff); + return str; + } else { + return buff; + } +} + char * safe_print_string(const char *str, unsigned long len) { diff --git a/src/misc.h b/src/misc.h index ae699dc..1b4b7cc 100644 --- a/src/misc.h +++ b/src/misc.h @@ -40,6 +40,7 @@ extern const char *my_basename(const char *str); extern unsigned long str_leading_match(register const char *, register const char *); extern char *str_trim(char *str); extern int parse_escaped_string(char *str); +extern spif_charptr_t escape_string(spif_charptr_t str, spif_char_t quote, spif_int32_t maxlen); extern char *safe_print_string(const char *buff, unsigned long len); extern unsigned long add_carriage_returns(unsigned char *buff, unsigned long cnt); extern unsigned char mkdirhier(const char *); diff --git a/src/options.c b/src/options.c index c004675..0469756 100644 --- a/src/options.c +++ b/src/options.c @@ -2567,6 +2567,15 @@ post_parse(void) { register int i; +#if DEBUG > 0 + if (DEBUG_LEVEL > DEBUG) { + print_warning("Requested debug level of %d exceeds compile-time maximum of %d\n", + DEBUG_LEVEL, DEBUG); + } else if (DEBUG_LEVEL > 0) { + DPRINTF1(("Now running with debugging level of %d\n", DEBUG_LEVEL)); + } +#endif + if (rs_scrollbar_type) { if (!strcasecmp(rs_scrollbar_type, "xterm")) { #ifdef XTERM_SCROLLBAR @@ -3839,7 +3848,11 @@ save_config(char *path, unsigned char save_theme) fprintf(fp, " min_anchor_size %d\n", rs_min_anchor_size); fprintf(fp, " border_width %d\n", TermWin.internalBorder); fprintf(fp, " term_name %s\n", getenv("TERM")); - fprintf(fp, " beep_command \"%s\"\n", rs_beep_command); + fprintf(fp, " beep_command \"%s\"\n", SPIF_CAST_PTR(char) ( + (rs_beep_command) + ? (SPIF_CAST_PTR(char) rs_beep_command) + : (SPIF_CAST_PTR(char) "") + )); fprintf(fp, " debug %d\n", DEBUG_LEVEL); if (save_theme && rs_exec_args && rs_theme && strcmp(rs_theme, PACKAGE)) { fprintf(fp, " exec "); @@ -3850,7 +3863,10 @@ save_config(char *path, unsigned char save_theme) } #ifdef CUTCHAR_OPTION if (rs_cutchars) { - fprintf(fp, " cut_chars '%s'\n", rs_cutchars); + spif_charptr_t cut_chars_escaped; + + cut_chars_escaped = escape_string(SPIF_CAST(charptr) rs_cutchars, '\"', 0); + fprintf(fp, " cut_chars \"%s\"\n", (char *) cut_chars_escaped); } #endif fprintf(fp, "end misc\n\n"); diff --git a/src/screen.c b/src/screen.c index 42508b8..6f79b7a 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1546,7 +1546,7 @@ scr_bell(void) if (BITFIELD_IS_SET(vt_options, VT_OPTIONS_VISUAL_BELL)) { scr_rvideo_mode(!rvideo); scr_rvideo_mode(!rvideo); - } else if (!SPIF_PTR_ISNULL(rs_beep_command)) { + } else if (!SPIF_PTR_ISNULL(rs_beep_command) && (*rs_beep_command)) { system_no_wait(SPIF_CAST_C(char *) rs_beep_command); } else { XBell(Xdisplay, 0); diff --git a/src/windows.c b/src/windows.c index 927bc90..65af83a 100644 --- a/src/windows.c +++ b/src/windows.c @@ -473,9 +473,7 @@ Create_Windows(int argc, char *argv[]) XClearWindow(Xdisplay, TermWin.vt); } XDefineCursor(Xdisplay, TermWin.vt, TermWin_cursor); - TermWin.mask = (KeyPressMask | EnterWindowMask | LeaveWindowMask | ExposureMask - | ButtonPressMask | ButtonReleaseMask | Button1MotionMask - | Button2MotionMask | Button3MotionMask); + TermWin.mask = (EnterWindowMask | LeaveWindowMask | ExposureMask | ButtonPressMask | ButtonReleaseMask | Button1MotionMask | Button2MotionMask | Button3MotionMask); XSelectInput(Xdisplay, TermWin.vt, TermWin.mask); /* If the user wants a specific desktop, tell the WM that */ diff --git a/themes/Makefile.am b/themes/Makefile.am index 58e83ea..e453971 100644 --- a/themes/Makefile.am +++ b/themes/Makefile.am @@ -27,3 +27,7 @@ install-data-hook: echo "ALERT! Not overwriting $$i theme in $(DESTDIR)$(pkgdatadir)/themes. You will need to update this theme manually." ; \ fi ; \ done + +uninstall-hook: + rm -rf $(DESTDIR)$(pkgdatadir)/themes +MAINTAINERCLEANFILES=Makefile.in diff --git a/utils/Makefile.am b/utils/Makefile.am index 6f6e373..9c4cd90 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -9,4 +9,6 @@ Esetroot_LDFLAGS = -rpath $(libdir):$(pkglibdir) Etbg_SOURCES = Etbg.c Ettable_SOURCES = Ettable.c +DISTCLEANFILES = kEsetroot EXTRA_DIST = Etcolors Etsearch kEsetroot.in Etbg_update_list +MAINTAINERCLEANFILES=Makefile.in