X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/4af8fe4e789162a3aea497f2a8218bc49aecdb60..4c4266d9c9530fc051a0506f915761bcc9f8c3c6:/util.c diff --git a/util.c b/util.c index bda3bc21..862e20c6 100644 --- a/util.c +++ b/util.c @@ -763,8 +763,9 @@ char curr_dir[MAXPATHLEN]; unsigned int curr_dir_len; /** - * Like chdir() but can be reversed with pop_dir() if @p save is set. - * It is also much faster as it remembers where we have been. + * Like chdir(), but it keeps track of the current directory (in the + * global "curr_dir"), and ensures that the path size doesn't overflow. + * Also cleans the path using the clean_fname() function. **/ int push_dir(char *dir) { @@ -804,7 +805,10 @@ int push_dir(char *dir) return 1; } -/** Reverse a push_dir() call */ +/** + * Reverse a push_dir() call. You must pass in an absolute path + * that was copied from a prior value of "curr_dir". + **/ int pop_dir(char *dir) { if (chdir(dir)) @@ -952,7 +956,7 @@ char *timestring(time_t t) struct tm *tm = localtime(&t); #ifdef HAVE_STRFTIME - strftime(TimeBuf,sizeof(TimeBuf)-1,"%Y/%m/%d %T",tm); + strftime(TimeBuf,sizeof(TimeBuf)-1,"%Y/%m/%d %H:%M:%S",tm); #else strlcpy(TimeBuf, asctime(tm), sizeof(TimeBuf)); #endif