Merge "filerepo: Replace confusing substr() with rtrim()"