diff options
author | Jean Delvare <jdelvare@suse.de> | 2014-03-12 14:28:36 +0100 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2014-03-12 14:28:36 +0100 |
commit | ac79c601f9300b80aff1c1efb745314996b47ef9 (patch) | |
tree | ffdb85c975340a33c1fa879d84f4cb48a68986c2 | |
parent | 1ce592cbeaa592d550d77daee219d306041d4739 (diff) | |
download | quilt-ac79c601f9300b80aff1c1efb745314996b47ef9.tar.gz |
Let print_patch print a newline character
Function print_patch currently doesn't print a newline character at
the end of the patch name. Because of this, callers which need the
newline character much wrap print_patch with an echo. This hurts
performance and isn't too elegant either.
So let print_patch print a trailing newline character. If the caller
doesn't need it, it will typically be stripped by bash anyway (tailing
whitespace is stripped on variable expansion.) And if the caller does
need it, it avoids the extra call to echo.
-rw-r--r-- | quilt/mail.in | 2 | ||||
-rw-r--r-- | quilt/next.in | 2 | ||||
-rw-r--r-- | quilt/previous.in | 2 | ||||
-rw-r--r-- | quilt/scripts/patchfns.in | 2 | ||||
-rw-r--r-- | quilt/top.in | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/quilt/mail.in b/quilt/mail.in index d88bea7..9837efe 100644 --- a/quilt/mail.in +++ b/quilt/mail.in @@ -466,7 +466,7 @@ dup_subjects=( $( } else subjects[$0] = patch }' \ | while read patch; do - echo "$(print_patch "$patch")" + print_patch $patch done ) ) if [ ${#dup_subjects[@]} -ne 0 ] diff --git a/quilt/next.in b/quilt/next.in index 9d1a40e..2a8e70d 100644 --- a/quilt/next.in +++ b/quilt/next.in @@ -61,7 +61,7 @@ next=$(find_unapplied_patch "$1") || exit if [ -n "$next" ] then - echo "$(print_patch $next)" + print_patch $next else exit 2 fi diff --git a/quilt/previous.in b/quilt/previous.in index e46b0b0..d8ac22e 100644 --- a/quilt/previous.in +++ b/quilt/previous.in @@ -62,7 +62,7 @@ patch=$(find_patch_in_series "$1") || exit 1 previous=$(applied_before "$patch" | tail -n 1) if [ -n "$previous" ] then - echo "$(print_patch $previous)" + print_patch $previous else exit 2 fi diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in index 37607ab..78cb4dc 100644 --- a/quilt/scripts/patchfns.in +++ b/quilt/scripts/patchfns.in @@ -950,7 +950,7 @@ version_check() print_patch() { - echo -n "${QUILT_PATCHES_PREFIX:+$SUBDIR_DOWN$QUILT_PATCHES/}$1" + echo "${QUILT_PATCHES_PREFIX:+$SUBDIR_DOWN$QUILT_PATCHES/}$1" } # Generate a format suitable to print patch names with printf diff --git a/quilt/top.in b/quilt/top.in index b8ff089..24251dc 100644 --- a/quilt/top.in +++ b/quilt/top.in @@ -58,7 +58,7 @@ then fi top=$(find_top_patch) || exit 2 -echo "$(print_patch "$top")" +print_patch $top ### Local Variables: ### mode: shell-script |