Up to [local] / src / usr.bin / tr
Request diff between arbitrary revisions
Default branch: MAIN
Current tag: OPENBSD_7_2
Revision 1.21 / (download) - annotate - [select for diffs], Fri Feb 11 16:09:21 2022 UTC (2 years, 3 months ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE,
OPENBSD_7_2,
OPENBSD_7_1_BASE,
OPENBSD_7_1
Changes since 1.20: +23 -22 lines
Diff to previous 1.20 (colored)
tr(1): rename lookup tables The lookup tables in tr(1) are called "string1" and "string2". This is misleading: - They aren't C strings, they are lookup tables. - The names "string1" and "string2" don't hint at what their contents actually mean. The meaning of a given table changes with tr(1)'s operating mode. There are five different modes. It would be considerably easier to see what is happening at a glance if the tables were named for their corresponding byte transformation. So instead of two tables named "string1" and "string2" we'll have three tables named "delete", "squeeze", and "translate". In addition, the "string" passed to the setup() function will be called a "table". With this patch the code in main() is way easier to understand. Hopefully this makes subsequent patches easier to review. Thread: https://marc.info/?l=openbsd-tech&m=164355980600901&w=2 No complaints on tech@ after over a week.