Skip to content

Commit

Permalink
Packages (Linux): remove possible final newlines in am config
Browse files Browse the repository at this point in the history
  • Loading branch information
CarterLi committed Jan 8, 2025
1 parent f9f15ba commit 8b3017c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/detection/packages/packages_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ static uint32_t getAMUser(void)
uint32_t baseLen = baseDir->length;
ffStrbufAppendS(baseDir, "appman/appman-config");
FF_STRBUF_AUTO_DESTROY packagesPath = ffStrbufCreate();
ffReadFileBuffer(baseDir->chars, &packagesPath);
if (ffReadFileBuffer(baseDir->chars, &packagesPath))
ffStrbufTrimRightSpace(&packagesPath);
ffStrbufSubstrBefore(baseDir, baseLen);

return packagesPath.length > 0 ? getAMPackages(&packagesPath) : 0;
Expand Down Expand Up @@ -701,5 +702,4 @@ void ffDetectPackagesImpl(FFPackagesResult* result, FFPackagesOptions* options)

if (!(options->disabled & FF_PACKAGES_FLAG_AM_BIT))
result->amUser = getAMUser();

}

0 comments on commit 8b3017c

Please sign in to comment.