# [PATCH v1] travis-ci: printf $STATUS as string

2 messages from 2017-04-26 to 2017-04-26. Participants: Lars Schneider, Johannes Schindelin.
Thread: https://gitlist.dev/t/45807

## Lars Schneider, 2017-04-26 19:39

Subject: [PATCH v1] travis-ci: printf $STATUS as string
Message-ID: <20170426193933.28961-1-larsxschneider@gmail.com>
URL: https://gitlist.dev/e/20170426193933.28961-1-larsxschneider%40gmail.com

```
If the $STATUS variable contains a "%" character then printf will
interpret that as invalid format string. Fix this by formatting $STATUS
as string.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
---

Notes:
    Base Ref: master
    Web-Diff: https://github.com/larsxschneider/git/commit/f08d4dc6a0
    Checkout: git fetch https://github.com/larsxschneider/git travisci/win-fix-v1 && git checkout f08d4dc6a0

 ci/run-windows-build.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ci/run-windows-build.sh b/ci/run-windows-build.sh
index 4e3a50b60e..e043440799 100755
--- a/ci/run-windows-build.sh
+++ b/ci/run-windows-build.sh
@@ -55,7 +55,7 @@ while true
 do
 	LAST_STATUS=$STATUS
 	STATUS=$(gfwci "action=status&buildId=$BUILD_ID")
-	test "$STATUS" = "$LAST_STATUS" || printf "\nStatus: $STATUS "
+	test "$STATUS" = "$LAST_STATUS" || printf "\nStatus: %s " "$STATUS"
 	printf "."
 
 	case "$STATUS" in

base-commit: e2cb6ab84c94f147f1259260961513b40c36108a
-- 
2.12.2


```

## Johannes Schindelin, 2017-04-26 19:49

Subject: Re: [PATCH v1] travis-ci: printf $STATUS as string
Message-ID: <alpine.DEB.2.20.1704262147550.3480@virtualbox>
URL: https://gitlist.dev/e/alpine.DEB.2.20.1704262147550.3480%40virtualbox
In-Reply-To: <20170426193933.28961-1-larsxschneider@gmail.com>

```
Hi,

On Wed, 26 Apr 2017, Lars Schneider wrote:

> If the $STATUS variable contains a "%" character then printf will
> interpret that as invalid format string. Fix this by formatting $STATUS
> as string.
> 
> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>

ACK.

For reference, the status should always be a single all-ASCII word, but
sometimes it looks as if there is a server error that returns a full-blown
HTML error page (including a style that contains something like 'width:
10%;' which would be misinterpreted by printf as a format string).

Ciao,
Dscho

```
