mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-11-01 00:09:38 +01:00 
			
		
		
		
	* fixed bug #16988 where setting the help label to a char other than a..z, a..z 0..9 would crash lazarus.
* also fixed a bug where if HelpFilesPath was left blank a PathDelimiter would be added resulting in a HelpFilesPath of "/" git-svn-id: trunk@26757 -
This commit is contained in:
		
							parent
							
								
									dacfafbe65
								
							
						
					
					
						commit
						b25ed48f65
					
				| @ -142,8 +142,13 @@ begin | ||||
| end; | ||||
| 
 | ||||
| procedure TChmHelpViewer.SetHelpLabel(AValue: String); | ||||
| var | ||||
|   i: Integer; | ||||
| begin | ||||
|  fHelpLabel := AValue; | ||||
|  for i := 1 to Length(fHelpLabel) do | ||||
|    if not (fHelpLabel[i] in ['a'..'z', '0'..'9', 'A'..'Z']) then | ||||
|      fHelpLabel[i] := '_'; | ||||
| end; | ||||
| 
 | ||||
| function TChmHelpViewer.CheckBuildLHelp: Integer; | ||||
| @ -360,7 +365,7 @@ begin | ||||
|   else | ||||
|     DocsDir := fChmsFilePath; | ||||
| 
 | ||||
|   FileName := DocsDir+FileName; | ||||
|   FileName := IncludeTrailingPathDelimiter(DocsDir)+FileName; | ||||
| 
 | ||||
|   fHelpConnection.StartHelpServer(HelpLabel, HelpExe); | ||||
|   Res := fHelpConnection.OpenURL(FileName, Url); | ||||
| @ -384,7 +389,7 @@ begin | ||||
|     Viewer:=TChmHelpViewer(Source); | ||||
|     HelpEXE:=Viewer.HelpEXE; | ||||
|     HelpLabel:=Viewer.HelpLabel; | ||||
|     HelpFilesPath:=IncludeTrailingPathDelimiter(Viewer.HelpFilesPath); | ||||
|     HelpFilesPath:=Viewer.HelpFilesPath; | ||||
|   end; | ||||
|   inherited Assign(Source); | ||||
| end; | ||||
| @ -393,7 +398,7 @@ procedure TChmHelpViewer.Load(Storage: TConfigStorage); | ||||
| begin | ||||
|   HelpEXE:=Storage.GetValue('CHMHelp/Exe',''); | ||||
|   HelpLabel:=Storage.GetValue('CHMHelp/Name','lazhelp'); | ||||
|   HelpFilesPath := IncludeTrailingPathDelimiter(Storage.GetValue('CHMHelp/FilesPath','')); | ||||
|   HelpFilesPath := Storage.GetValue('CHMHelp/FilesPath',''); | ||||
| end; | ||||
| 
 | ||||
| procedure TChmHelpViewer.Save(Storage: TConfigStorage); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 andrew
						andrew