Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-cmds
Commits
72694ed6
Commit
72694ed6
authored
Aug 07, 2016
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: fix panic when stdin is empty for string args
License: MIT Signed-off-by:
Jeromy
<
why@ipfs.io
>
parent
4776d44d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
request.go
request.go
+6
-0
No files found.
request.go
View file @
72694ed6
...
...
@@ -240,13 +240,19 @@ func (r *request) VarArgs(f func(string) error) error {
return
err
}
var
any
bool
scan
:=
bufio
.
NewScanner
(
fi
)
for
scan
.
Scan
()
{
any
=
true
err
:=
f
(
scan
.
Text
())
if
err
!=
nil
{
return
err
}
}
if
!
any
{
return
f
(
""
)
}
return
nil
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment