| От | Tom Lane |
|---|---|
| Тема | relative_path() seems overly complicated and buggy |
| Дата | |
| Msg-id | 11365.1099772806@sss.pgh.pa.us обсуждение |
| Ответы |
Re: relative_path() seems overly complicated and buggy
|
| Список | pgsql-hackers |
There's at least one bug in path.c's relative_path(): it will think
"/foo/a/b" is equal to "/foo/ab" because it skips directory separators
independently in the two strings. The code is sufficiently complex that
I have little faith in it not having any other bugs, either.
I believe that it's unnecessary for relative_path to be so tense
about trying to implement platform-weirdness-aware comparison of paths.
It is not called on arbitrary paths, but only on the compiled-in
paths that were generated by configure. Therefore it is reasonable
to assume that the common prefix we are trying to identify is spelled
exactly the same in both paths.
What I'd like to do is simplify it to just check for exact equality
up through the last directory separator in bin_path. Any objections?
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера