Fix #981, implement better filename parser #1156
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe the contribution
Implemements a new function in FS to parse an input file name from a user -
CFE_FS_ParseInputFileName()
The new function produces fully-qualified output where the input may omit either a pathname or an extension. These items will be added from the specified defaults, if missing, and a complete fully-qualified filename will be output.
If the input is already a fully qualified filename, then the output is the same as the input (basically a copy).
This initially is used to provide better cross-platform startup script processing, where module suffix may differ across platforms. Only the "basename" of the filename needs to be specified in the startup script - everything else can come from defaults.
Fixes #981
Testing performed
Build and sanity test CFE.
Check startup with all combinations of filename in script - fully qualified, basename only.
Check startup with new default startup script that has basename only - works on both Linux (.so) and RTEMS (.obj) with no change.
Expected behavior changes
Easier switching between platforms - startup script does not need to change to account for the different suffix that different platforms use.
System(s) tested on
Ubuntu 20.04 (native)
RTEMS 4.11 (i686, QEMU)
Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.