Re: [PATCH] opening files in remote.c should ensure it is opening a file

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <gitster@...>
Cc: H.Merijn Brand <h.m.brand@...>, <git@...>
Date: Friday, February 8, 2008 - 4:38 pm

Hi,

On Fri, 8 Feb 2008, Junio C Hamano wrote:


You mean something like

#ifdef FOPEN_OPENS_DIRECTORIES
inline static FILE *fopen_compat(const char *path, const char *mode)
{
       struct stat st_buf;
       if (stat(path, &st_buf) || !S_ISREG(st_buf.st_mode))
               return NULL;
       return (fopen(path, mode));
}
#define fopen fopen_compat
#endif

in git-compat-util.h, right?

Yeah, I can see that, even if I think the overhead would not be _that_ 
crucial.  But it is a nice way of fixing _all_ fopen() calls at the same 
time.

Ciao,
Dscho
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] opening files in remote.c should ensure it is op..., Johannes Schindelin, (Fri Feb 8, 4:40 pm)
Re: [PATCH] opening files in remote.c should ensure it is op..., Johannes Schindelin, (Fri Feb 8, 5:47 pm)
Re: [PATCH] opening files in remote.c should ensure it is op..., Johannes Schindelin, (Fri Feb 8, 4:38 pm)
Re: [PATCH] opening files in remote.c should ensure it is op..., Johannes Schindelin, (Fri Feb 8, 4:44 pm)