Re: psql \ir filename normalization

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: psql \ir filename normalization
Дата
Msg-id 201111211805.pALI57V25371@momjian.us
обсуждение исходный текст
Ответ на Re: psql \ir filename normalization  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: psql \ir filename normalization  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas wrote:
> Argh.  The root of the problem here seems to be that
> join_path_components() feels entitled to arbitrarily insert a pathname
> separator at the front of the output string even if its first input
> didn't begin with one originally.  Lame!

The attached patch fixes this report, I think.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/src/port/path.c b/src/port/path.c
new file mode 100644
index 13ca4f3..9cb0b01
*** a/src/port/path.c
--- b/src/port/path.c
*************** join_path_components(char *ret_path,
*** 212,218 ****
      }
      if (*tail)
          snprintf(ret_path + strlen(ret_path), MAXPGPATH - strlen(ret_path),
!                  "/%s", tail);
  }


--- 212,219 ----
      }
      if (*tail)
          snprintf(ret_path + strlen(ret_path), MAXPGPATH - strlen(ret_path),
!                 /* only add slash if there is something already in head */
!                  "%s%s", head[0] ? "/" : "", tail);
  }



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Joshua Berkus
Дата:
Сообщение: Re: ISN was: Core Extensions relocation
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Client library cross-compiling: Win32, Win64, MacOSX. Possible?