Zach Irmen <zirmen(at)shaw(dot)ca> writes:
> A reviewable patch that could handle tilde expansion for
> psql \i ~/filename
Needs a bit of work. What happens if getenv("HOME") returns NULL?
You also need to think about Windows (dunno if the whole thing is
even meaningful there, but if it is then you need to allow for
backslash path separators). Finally, couldn't we reduce the number
of times strings are strdup'd only to be freed again? I don't think
doing it this way makes the code simpler --- it took me a fair while
to convince myself there was no memory leak.
regards, tom lane