From 8d48020ab0d71eb1f6d0bd96c628ca4ad50bb952 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 9 Apr 2013 03:29:39 +0200 Subject: [PATCH] 2013-04-09 03:27 UTC+0200 Viktor Szakats (harbour syenar.net) * bin/check.hb * deleted one more contrib exception * contrib/make.hb * do not try to build contribs/addons that don't exist * contrib/hbmisc/tests/pe.prg - contrib/hbmisc/tests/sample.txt * avoid storing non-ASCII, non-UTF8 file on disk * load above if no parameter given ! use hb_MemoWrit() to write result --- ChangeLog.txt | 13 ++++++++++ bin/check.hb | 3 +-- contrib/hbmisc/tests/pe.prg | 45 ++++++++++++++++++++++++++++++--- contrib/hbmisc/tests/sample.txt | 27 -------------------- contrib/make.hb | 8 ++++-- 5 files changed, 61 insertions(+), 35 deletions(-) delete mode 100644 contrib/hbmisc/tests/sample.txt diff --git a/ChangeLog.txt b/ChangeLog.txt index c7c509bc47..5fdfaae7f9 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,19 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-04-09 03:27 UTC+0200 Viktor Szakats (harbour syenar.net) + * bin/check.hb + * deleted one more contrib exception + + * contrib/make.hb + * do not try to build contribs/addons that don't exist + + * contrib/hbmisc/tests/pe.prg + - contrib/hbmisc/tests/sample.txt + * avoid storing non-ASCII, non-UTF8 file on disk + * load above if no parameter given + ! use hb_MemoWrit() to write result + 2013-04-08 19:44 UTC+0200 Viktor Szakats (harbour syenar.net) * bin/commit.hb + implement prepare-commit hook, which fills the commit message with the last changelog entry diff --git a/bin/check.hb b/bin/check.hb index 9983c85671..4216345b80 100644 --- a/bin/check.hb +++ b/bin/check.hb @@ -141,8 +141,7 @@ STATIC FUNCTION CheckFile( cName, /* @ */ aErr, lApplyFixes ) "*.md" } LOCAL aCanHaveAnyEncoding := { ; - "*.dif", ; - "contrib/hbmisc/tests/sample.txt" } /* TOFIX: Not Unicode compatible component */ + "*.dif" } LOCAL aForcedCRLF := { ; "*.bat" } diff --git a/contrib/hbmisc/tests/pe.prg b/contrib/hbmisc/tests/pe.prg index f477a48cc1..c0948b62f0 100644 --- a/contrib/hbmisc/tests/pe.prg +++ b/contrib/hbmisc/tests/pe.prg @@ -7,13 +7,16 @@ PROCEDURE Main( cFile ) LOCAL lEdit := .T. IF cFile == NIL - cFile := __FILE__ - lEdit := .F. + cText := Example_Text() + ELSE + IF hb_FileMatch( cFile, __FILE__ ) + lEdit := .F. + ENDIF + cText := MemoRead( cFile ) ENDIF - cText := MemoRead( cFile ) cText := MyMemoEdit( cText, 0, 0, MaxRow(), MaxCol(), lEdit ) - MemoWrit( hb_FNameExtSet( __FILE__, ".out" ), cText ) + hb_MemoWrit( hb_FNameExtSet( __FILE__, ".out" ), cText ) RETURN @@ -36,3 +39,37 @@ STATIC FUNCTION MyMemoEdit( cText, nTop, nLeft, nBottom, nRight, lEdit ) ENDIF RETURN cText + +STATIC FUNCTION Example_Text() + RETURN StrTran( Example_Text_Raw(), "~", hb_BChar( 168 ) ) + +STATIC FUNCTION Example_Text_Raw() +#pragma __cstream | RETURN %s + + ~2THE HARBOUR PROJECT LICENSE~1 +~3 =========================== + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version, with one exception: + + The exception is that if you link the Harbour Runtime Library (HRL) + and/or the Harbour Virtual Machine (HVM) with other files to produce + an executable, this does not by itself cause the resulting executable + to be covered by the GNU General Public License. Your use of that + executable is in no way restricted on account of linking the HRL + and/or HVM code into it. + + This program is distributed in the hope that it will be useful, + but ~2WITHOUT ANY WARRANTY~1; without even the implied warranty of + ~4MERCHANTABILITY~1 or ~5FITNESS FOR A PARTICULAR PURPOSE~1. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit + their web site at http://www.gnu.org/). + +~5This file have to be separated with CR/LF characters~1 +#pragma __endtext diff --git a/contrib/hbmisc/tests/sample.txt b/contrib/hbmisc/tests/sample.txt deleted file mode 100644 index d2c54a8004..0000000000 --- a/contrib/hbmisc/tests/sample.txt +++ /dev/null @@ -1,27 +0,0 @@ - - ¨2THE HARBOUR PROJECT LICENSE¨1 -¨3 =========================== - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version, with one exception: - - The exception is that if you link the Harbour Runtime Library (HRL) - and/or the Harbour Virtual Machine (HVM) with other files to produce - an executable, this does not by itself cause the resulting executable - to be covered by the GNU General Public License. Your use of that - executable is in no way restricted on account of linking the HRL - and/or HVM code into it. - - This program is distributed in the hope that it will be useful, - but ¨2WITHOUT ANY WARRANTY¨1; without even the implied warranty of - ¨4MERCHANTABILITY¨1 or ¨5FITNESS FOR A PARTICULAR PURPOSE¨1. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit - their web site at http://www.gnu.org/). - -¨5This file have to be separated with CR/LF characters¨1 diff --git a/contrib/make.hb b/contrib/make.hb index c9ace54dc5..6a0c06fc9d 100755 --- a/contrib/make.hb +++ b/contrib/make.hb @@ -762,7 +762,9 @@ PROCEDURE LoadProjectListFromFile( hProjectList, cFileName ) IF "#" $ cItem cItem := Left( cItem, At( "#", cItem ) - 1 ) ENDIF - AddProject( hProjectList, cItem ) + IF hb_FileExists( s_cBase + s_cHome + cItem ) + AddProject( hProjectList, cItem ) + ENDIF NEXT RETURN @@ -772,7 +774,9 @@ PROCEDURE LoadProjectListFromString( hProjectList, cString ) LOCAL cItem FOR EACH cItem IN hb_ATokens( cString,, .T. ) - AddProject( hProjectList, cItem ) + IF hb_FileExists( s_cBase + s_cHome + cItem ) + AddProject( hProjectList, cItem ) + ENDIF NEXT RETURN