Re: system() patch for Win32
| От | Tom Lane |
|---|---|
| Тема | Re: system() patch for Win32 |
| Дата | |
| Msg-id | 28282.1049381007@sss.pgh.pa.us обсуждение |
| Ответ на | system() patch for Win32 (Bruce Momjian <pgman@candle.pha.pa.us>) |
| Ответы |
Re: system() patch for Win32
|
| Список | pgsql-patches |
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Here is a patch to handle 'rm', 'cp', and 'exec' usage by system();
> again very small.
This part seems unnecessarily obscurantist:
> ! #ifndef WIN32
> ! #define EXEC "exec "
> ! #else
> ! #define EXEC ""
> ! #endif
> ! sprintf(sys, "%s%s '%s'", EXEC, editorName, fname);
I like the other style (just #ifdef to choose one of two sprintf
commands) better. It seems easier to understand, as well as less
fragile --- the way you have it here makes it *real* easy to break
the computation of the buffer size for the command string.
regards, tom lane
В списке pgsql-patches по дате отправления: