From 9e95d1204b9a05638e912d98ea3d1abf5faa35fd Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Wed, 20 Aug 2008 14:11:05 +0200 Subject: FPC 2.2.2 compatibility --- libgtk_kylix/GTKStdCtrls.pas | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libgtk_kylix/GTKStdCtrls.pas b/libgtk_kylix/GTKStdCtrls.pas index 1d4157a..f2a2ec2 100644 --- a/libgtk_kylix/GTKStdCtrls.pas +++ b/libgtk_kylix/GTKStdCtrls.pas @@ -421,11 +421,10 @@ begin end; function TGTKMisc.GetXPadding: integer; -var xpad, ypad: pgint; +var xpad, ypad: gint; begin - gtk_misc_get_padding(PGtkMisc(FWidget), xpad, ypad); - if Assigned(xpad) then Result := Integer(xpad) - else Result := 0; + gtk_misc_get_padding(PGtkMisc(FWidget), @xpad, @ypad); + Result := xpad; end; procedure TGTKMisc.SetXPadding(Value: integer); @@ -434,11 +433,10 @@ begin end; function TGTKMisc.GetYPadding: integer; -var xpad, ypad: pgint; +var xpad, ypad: gint; begin - gtk_misc_get_padding(PGtkMisc(FWidget), xpad, ypad); - if Assigned(ypad) then Result := Integer(ypad) - else Result := 0; + gtk_misc_get_padding(PGtkMisc(FWidget), @xpad, @ypad); + Result := ypad; end; procedure TGTKMisc.SetYPadding(Value: integer); -- cgit v1.2.3 From 4ca87806591ddb110edccd91e7b581c40a1beb72 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Wed, 20 Aug 2008 14:25:46 +0200 Subject: Always use smartlinking to prevent unresolved symbols messages --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cd72bc1..439665b 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,8 @@ LIB_SUFFIX=`if test \`uname -m\` = x86_64; then echo 64; fi` # -Ct must be disabled here, causes unneeded crashes # -CR and -Cr must be disabled here, causes range check errors with gnome-power-manager # -Cg generates internal compiler errors on i386 -CFLAGS= -vweh -Un -Ci -Co +# -XX prevents linking errors of unresolved and unused symbols +CFLAGS= -vweh -Un -Ci -Co -XX -- cgit v1.2.3 From f3f664b6dd8181c079a7c495390063336396532e Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 21 Aug 2008 17:45:38 +0200 Subject: Mark stack as not executable, fixes SELinux issues http://bugs.freepascal.org/view.php?id=11563 --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 439665b..5b5ca89 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,8 @@ LIB_SUFFIX=`if test \`uname -m\` = x86_64; then echo 64; fi` # -CR and -Cr must be disabled here, causes range check errors with gnome-power-manager # -Cg generates internal compiler errors on i386 # -XX prevents linking errors of unresolved and unused symbols -CFLAGS= -vweh -Un -Ci -Co -XX +# "-k-z noexecstack" (with quotes as a single parameter) avoids marking stack as executable, allowing to work correctly with SELinux in Enforcing mode +CFLAGS= -vweh -Un -Ci -Co -XX "-k-z noexecstack" -- cgit v1.2.3 From 4c57ea157b3ee4b9d9b9716c27a538540b73fcd9 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 21 Aug 2008 17:53:01 +0200 Subject: FPC Compatibility fixes --- libgtk_kylix/GTKStdCtrls.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libgtk_kylix/GTKStdCtrls.pas b/libgtk_kylix/GTKStdCtrls.pas index f2a2ec2..1cccdf8 100644 --- a/libgtk_kylix/GTKStdCtrls.pas +++ b/libgtk_kylix/GTKStdCtrls.pas @@ -420,10 +420,12 @@ begin gtk_misc_set_padding(PGtkMisc(FWidget), XPadding, YPadding); end; +procedure x_gtk_misc_get_padding(misc:PGtkMisc; xpad:Pgint; ypad:Pgint); cdecl; external gtklib name 'gtk_misc_get_padding'; + function TGTKMisc.GetXPadding: integer; var xpad, ypad: gint; begin - gtk_misc_get_padding(PGtkMisc(FWidget), @xpad, @ypad); + x_gtk_misc_get_padding(PGtkMisc(FWidget), @xpad, @ypad); Result := xpad; end; @@ -435,7 +437,7 @@ end; function TGTKMisc.GetYPadding: integer; var xpad, ypad: gint; begin - gtk_misc_get_padding(PGtkMisc(FWidget), @xpad, @ypad); + x_gtk_misc_get_padding(PGtkMisc(FWidget), @xpad, @ypad); Result := ypad; end; -- cgit v1.2.3 From f8012d552a33d5615e5711c82bf22bc3bcdc3d23 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 21 Aug 2008 22:20:07 +0200 Subject: Fix multiple extensions recognition --- UConfig.pas | 4 ++-- UFileAssoc.pas | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/UConfig.pas b/UConfig.pas index 98c1938..f66c732 100644 --- a/UConfig.pas +++ b/UConfig.pas @@ -25,8 +25,8 @@ uses Classes, ULocale; resourcestring ConstAppTitle = 'Tux Commander'; - ConstAboutVersion = '0.6.45-dev'; - ConstAboutBuildDate = '2008-06-18'; + ConstAboutVersion = '0.6.46-dev'; + ConstAboutBuildDate = '2008-08-21'; {$IFDEF FPC} {$INCLUDE fpcver.inc} diff --git a/UFileAssoc.pas b/UFileAssoc.pas index 10d0f73..923ecac 100644 --- a/UFileAssoc.pas +++ b/UFileAssoc.pas @@ -21,7 +21,7 @@ unit UFileAssoc; interface -uses Classes, SysUtils, GTKPixbuf, GTKClasses, GTKUtils, UEngines, UVFSCore, UCoreUtils; +uses Classes, SysUtils, StrUtils, GTKPixbuf, GTKClasses, GTKUtils, UEngines, UVFSCore, UCoreUtils; type TAssocAction = class ActionName, ActionCommand: string; @@ -164,9 +164,8 @@ end; function FindVFSPlugin(Filename: string): TVFSPlugin; var Ext, s: string; b: boolean; - i, j, Last, MaxFound: integer; + i, j, MaxFound: integer; begin - b := False; Result := nil; MaxFound := 0; if (Pos('.', Filename) > 1) and (LastDelimiter('.', Filename) < Length(Filename)) then begin @@ -181,7 +180,7 @@ begin s := ANSIUpperCase(IncludeLeadingDot(Extensions[j])); if Length(Ext) = Length(s) then b := (Ext = s) and (Length(s) > MaxFound) - else b := (Pos(s, Ext) > 0) and (Pos(s, Ext) = (Length(Ext) - Length(s) + 1)) and (Length(s) > MaxFound); + else b := (Pos(s, Ext) > 0) and (RightStr(Ext, Length(s)) = s) and (Length(s) > MaxFound); if b then Break; end; if b then begin @@ -195,9 +194,8 @@ end; function FindAssoc(Filename: string): TFileAssoc; var Ext, s: string; b: boolean; - i, j, Last, MaxFound: integer; + i, j, MaxFound: integer; begin - b := False; Result := nil; MaxFound := 0; if (Pos('.', Filename) > 1) and (LastDelimiter('.', Filename) < Length(Filename)) then begin @@ -212,7 +210,7 @@ begin s := ANSIUpperCase(IncludeLeadingDot(Extensions[j])); if Length(Ext) = Length(s) then b := (Ext = s) and (Length(s) > MaxFound) - else b := (Pos(s, Ext) > 0) and (Pos(s, Ext) = (Length(Ext) - Length(s) + 1)) and (Length(s) > MaxFound); + else b := (Pos(s, Ext) > 0) and (RightStr(Ext, Length(s)) = s) and (Length(s) > MaxFound); if b then Break; end; if b then begin -- cgit v1.2.3