aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-10-13 17:03:30 +1300
committerTom Ryder <tom@sanctum.geek.nz>2014-10-13 17:03:30 +1300
commit4dd113debf5af27e12069f554bee5996810f5d76 (patch)
tree153b899abeaeae948c00898cd8573c0f685383fc /bash
parentUse arith context for boolean vars (diff)
downloaddotfiles-4dd113debf5af27e12069f554bee5996810f5d76.tar.gz
dotfiles-4dd113debf5af27e12069f554bee5996810f5d76.zip
Initialize flag vars
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc.d/prompt.bash6
1 files changed, 3 insertions, 3 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index b505fa97..b4f0e735 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -80,7 +80,7 @@ prompt() {
# Safely read status with -z --porcelain
local line
- local -i ready modified untracked
+ local -i ready=0 modified=0 untracked=0
while IFS= read -d $'\0' -r line ; do
if [[ $line == [MADRCT]* ]] ; then
ready=1
@@ -133,7 +133,7 @@ prompt() {
# Safely read status with -0
local line
- local -i modified untracked
+ local -i modified=0 untracked=0
while IFS= read -d $'\0' -r line ; do
if [[ $line == '?'* ]] ; then
untracked=1
@@ -192,7 +192,7 @@ prompt() {
# Parse the output of svn status to determine working copy state
local symbol
- local -i modified untracked
+ local -i modified=0 untracked=0
while read -r symbol _ ; do
if [[ $symbol == *'?'* ]] ; then
untracked=1