Skip to content

Commit

Permalink
1-liner: each -e statement should be separate line,
Browse files Browse the repository at this point in the history
and previous version would fail with, e.g. comment lines,
Now they are all separate lines.
  • Loading branch information
albuspiroglu committed Jul 2, 2017
1 parent 0818f9f commit 6589911
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions basic/oneliner
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ HERE

# an example of escaping double-quotes
../c99sh -e 'printf("\"Hello ");' -e 'printf("World\" ");' -e 'printf("from 1-liner\n");'

../c99sh -e '#define w1 "Hello"' -e '#define w2 "World"' -e 'printf("%s %s\n", w1, w2);'
4 changes: 3 additions & 1 deletion c99sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ emit_main_close() {
echo "#line 1 \"$f\"" >>"$c"
if [ $oneline -eq 1 ]
then
echo ${stmts[@]} >> "$c"
for ((i = 0; i < $stmtcnt; ++i)); do
echo ${stmts[$i]} >> "$c"
done
fi

if [[ ($oneline -eq 1 && $m -gt 0) || $oneline -eq 0 ]]
Expand Down

0 comments on commit 6589911

Please sign in to comment.