Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add --quiet/-q option. Contributed by Rich Salz salzr@certco.com.
[rsync/rsync.git]
/
authenticate.c
diff --git
a/authenticate.c
b/authenticate.c
index
896366a
..
885e40b
100644
(file)
--- a/
authenticate.c
+++ b/
authenticate.c
@@
-170,8
+170,10
@@
static char *getpassf(char *filename)
buffer[sizeof(buffer)-1]='\0';
if ( (len=read(fd,buffer,sizeof(buffer)-1)) > 0)
{
buffer[sizeof(buffer)-1]='\0';
if ( (len=read(fd,buffer,sizeof(buffer)-1)) > 0)
{
+ char *p = strtok(buffer,"\n\r");
close(fd);
close(fd);
- return strdup(strtok(buffer,"\n\r"));
+ if (p) p = strdup(p);
+ return p;
}
return NULL;
}
return NULL;