From 14dcb1b93a4c568d3613e1b24beebc9e32f25c2d Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Mon, 15 Sep 2003 08:12:13 +0000 Subject: [PATCH] POSIX-compliant sed. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7743 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/xforms/ChangeLog | 4 ++++ src/frontends/xforms/forms/fdfixc.sed | 2 +- src/frontends/xforms/forms/fdfixh.sed | 16 ++++++++++++---- src/frontends/xforms/forms/tmp_str.sed | 9 ++++++--- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index c8a32273ce..bdffed619e 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2003-09-15 Angus Leeming + + * forms/fdfix[ch].sed, tmp_str,sed: POSIX-compliant sed. + 2003-09-09 Lars Gullik Bjønnes * several files: change Assert to BOOST_ASSERT diff --git a/src/frontends/xforms/forms/fdfixc.sed b/src/frontends/xforms/forms/fdfixc.sed index fb7b80de2b..7137e3556f 100644 --- a/src/frontends/xforms/forms/fdfixc.sed +++ b/src/frontends/xforms/forms/fdfixc.sed @@ -23,7 +23,7 @@ s/[ ]*$// # Remove '#include "forms.h"'. It is replace by a macro in fdfix.sh. -/^#include \"forms\.h\"/d +/^#include "forms\.h"/d # Pretty formatting; replace all leading whitespace with a tab diff --git a/src/frontends/xforms/forms/fdfixh.sed b/src/frontends/xforms/forms/fdfixh.sed index b8550f9efc..6634d9703e 100644 --- a/src/frontends/xforms/forms/fdfixh.sed +++ b/src/frontends/xforms/forms/fdfixh.sed @@ -70,7 +70,9 @@ s/extern \(.*\) create_form_form_\(.*\)[(]void[)]/\1 build_\2(void *)/ # All other lines are deleted: /^typedef struct/d -/^ /{ /FL_OBJECT/!d; } +/^ /{ +/FL_OBJECT/!d +} # For all lines starting with FL_OBJECT... @@ -80,7 +82,8 @@ s/extern \(.*\) create_form_form_\(.*\)[(]void[)]/\1 build_\2(void *)/ s/\(FL_OBJECT \*\)/\1 / # 2. Append to the hold space and delete from the pattern space. -H; d +H +d } @@ -95,11 +98,16 @@ struct \1 : public FD_base {/ # 2. The hold space contains the FL_OBJECT lines, preceded by a new line. # To get rid of this new line, we exchange the contents of the hold and # pattern spaces, remove the new line and then exchange back. -x; s/^\n//; x +x +s/^\n// +x # 3. Paste the contents of the hold space beneath the "struct FD_xxx" line. # and empty the hold space -G; h; s/.*//; x +G +h +s/.*// +x # 4. Close the struct and append an empty line. a\ diff --git a/src/frontends/xforms/forms/tmp_str.sed b/src/frontends/xforms/forms/tmp_str.sed index 60e0fad2a1..992e9e6578 100644 --- a/src/frontends/xforms/forms/tmp_str.sed +++ b/src/frontends/xforms/forms/tmp_str.sed @@ -16,7 +16,8 @@ # Initialise the hold space at the start of the function. / \* build_/ { -h; d +h +d } @@ -25,14 +26,16 @@ h; d # If it isn't the last line, append it to the hold space. /^}$/!{ -H; d +H +d } # If it is the last line, paste the contents of the hold space above it, # seach for the string "tmp_str" and, if found, add its declaration to the top # of the function. /^}$/ { -x; G +x +G /tmp_str/s/\( FL_OBJECT \*\)/ string tmp_str;\ \1/