]> granicus.if.org Git - postgresql/commit
I guess I'd vote for changing the code to be
authorBruce Momjian <bruce@momjian.us>
Wed, 14 Aug 2002 05:49:22 +0000 (05:49 +0000)
committerBruce Momjian <bruce@momjian.us>
Wed, 14 Aug 2002 05:49:22 +0000 (05:49 +0000)
commitdec918479ff8aec20f531a88f53b71fecba4067a
tree1fe7c0c583409a752d4e869139751ef10ef238ee
parent538b1015958dbbe447434909a6412e79d4298643
I guess I'd vote for changing the code to be

        sys = malloc(strlen(editorName) + strlen(fname) + 10 + 1);
        if (!sys)
                return false;
        sprintf(sys, "exec '%s' '%s'", editorName, fname);

(note the added quotes to provide a little protection against spaces
and such).  Then it's perfectly obvious what the calculation is doing.
I don't care about wasting 20-some bytes, but confusing readers of the
code is worth avoiding.

                        regards, tom lane
doc/TODO
src/bin/psql/command.c