From 3174e4f659e20655d212ffaf25faa9a786b93f31 Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Mon, 10 Jan 2011 03:51:55 -0500 Subject: [PATCH] Include xterm BEL sequence to terminate OSC, standardize Makefile variables --- Makefile | 12 ++++++------ parse.cpp | 4 +++- parserstate.cpp | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 1b295d8..29d16c6 100644 --- a/Makefile +++ b/Makefile @@ -2,25 +2,25 @@ source = parse.cpp parserstate.cpp parser.cpp templates.cpp objects = parserstate.o parser.o templates.o executables = parse -CPP = g++ -CPPFLAGS = -g --std=c++0x -pedantic -Werror -Wall -Wextra -Weffc++ -fno-implicit-templates -pipe -D_FILE_OFFSET_BITS=64 -D_XOPEN_SOURCE=500 -D_GNU_SOURCE +CXX = g++ +CXXFLAGS = -g --std=c++0x -pedantic -Werror -Wall -Wextra -Weffc++ -fno-implicit-templates -pipe -D_FILE_OFFSET_BITS=64 -D_XOPEN_SOURCE=500 -D_GNU_SOURCE LIBS = -lutil all: $(executables) parse: parse.o $(objects) - $(CPP) $(CPPFLAGS) -o $@ $+ $(LIBS) + $(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS) templates.o: templates.cpp - $(CPP) $(CPPFLAGS) -frepo -c -o $@ $< + $(CXX) $(CXXFLAGS) -frepo -c -o $@ $< %.o: %.cpp - $(CPP) $(CPPFLAGS) -c -o $@ $< + $(CXX) $(CXXFLAGS) -c -o $@ $< include depend depend: $(source) - $(CPP) $(INCLUDES) -MM $(source) > depend + $(CXX) $(INCLUDES) -MM $(source) > depend .PHONY: clean clean: diff --git a/parse.cpp b/parse.cpp index 0956b42..588fb55 100644 --- a/parse.cpp +++ b/parse.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include "parser.hpp" @@ -253,8 +254,9 @@ int vt_parser( struct stripstate *state ) for ( std::vector::iterator j = actions.begin(); j != actions.end(); j++ ) { + if ( j->char_present ) { - printf( "%s(%lc) ", j->name.c_str(), j->ch ); + printf( "%s(0x%02d=%lc) ", j->name.c_str(), j->ch, j->ch ); } else { printf( "[%s] ", j->name.c_str() ); } diff --git a/parserstate.cpp b/parserstate.cpp index 4a634fa..0d39c9a 100644 --- a/parserstate.cpp +++ b/parserstate.cpp @@ -339,7 +339,7 @@ Transition OSC_String::input_state_rule( wchar_t ch ) return Transition( OSC_Put(), NULL ); } - if ( ch == 0x9C ) { + if ( (ch == 0x9C) || (ch == 0x07) ) { /* 0x07 is xterm non-ANSI variant */ return Transition( Ignore(), &family->s_Ground ); }