View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0038368 | FPC | Documentation | public | 2021-01-18 08:22 | 2021-01-24 21:40 |
Reporter | Trevor Roydhouse | Assigned To | Michael Van Canneyt | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Apple | OS | macOS | ||
Fixed in Version | 3.3.1 | ||||
Summary | 0038368: 12.2 Creating a library (text and code need some fixes) | ||||
Description | https://www.freepascal.org/docs-html/current/prog/progse55.html "Compilation of this source will result in the creation of a library called libsubs.so on unix systems, or subs.dll on Windows or os/2." The above statement is incorrect. macOS is a certified UNIX and the library name is libsubs.dylib. Perhaps reword as follows: "Compilation of this source will result in the creation of a library called libsubs.dylib on macOS, libsubs.so on UNIX-like (eg FreeBSD, Linux) systems, or subs.dll on Windows or OS/2." I believe the library code presented is also incorrect: begin if Length >= FromPos then SubStr := CString + FromPos - 1; if Length > ToPos then CString[ToPos] := #0; end; should, I believe, be: begin if Length >= FromPos then SubStr := CString + FromPos; <<< remove minus 1 if Length > ToPos + 1 then <<< add plus 1 CString[ToPos + 1] := #0; <<< add plus 1 end; otherwise with a test string of "1234" the result of SubStr(s, 1, 3) is "12" and not "123" and the result of SubStr(s, 2, 4) is "1234" and not "234". | ||||
Steps To Reproduce | Use the example library in a program. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 1797 | ||||
FPCOldBugId | |||||
FPCTarget | 3.2.2 | ||||
Attached Files |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2021-01-18 08:22 | Trevor Roydhouse | New Issue | |
2021-01-18 08:22 | Trevor Roydhouse | Status | new => assigned |
2021-01-18 08:22 | Trevor Roydhouse | Assigned To | => Michael Van Canneyt |
2021-01-24 19:28 | Michael Van Canneyt | Status | assigned => resolved |
2021-01-24 19:28 | Michael Van Canneyt | Resolution | open => fixed |
2021-01-24 19:28 | Michael Van Canneyt | Fixed in Version | => 3.3.1 |
2021-01-24 19:28 | Michael Van Canneyt | Fixed in Revision | => 1797 |
2021-01-24 19:28 | Michael Van Canneyt | FPCTarget | => 3.2.2 |
2021-01-24 19:28 | Michael Van Canneyt | Note Added: 0128569 | |
2021-01-24 21:40 | Trevor Roydhouse | Status | resolved => closed |
2021-01-24 21:40 | Trevor Roydhouse | Note Added: 0128573 |