Skip to content

Commit

Permalink
real_path_internal(): add comment explaining use of cwd
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>
  • Loading branch information
Michael Haggerty authored and Jeff King committed Oct 29, 2012
1 parent 038e55f commit d6052ab
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions abspath.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ static const char *real_path_internal(const char *path, int die_on_error)
{
static char bufs[2][PATH_MAX + 1], *buf = bufs[0], *next_buf = bufs[1];
char *retval = NULL;

/*
* If we have to temporarily chdir(), store the original CWD
* here so that we can chdir() back to it at the end of the
* function:
*/
char cwd[1024] = "";

int buf_index = 1;

int depth = MAXDEPTH;
Expand Down

0 comments on commit d6052ab

Please sign in to comment.