From 0115695feb600a313b6e442dc45d8e6487ededf8 Mon Sep 17 00:00:00 2001
From: Morris Jette <jette@schedmd.com>
Date: Thu, 26 Apr 2012 08:51:29 -0700
Subject: [PATCH] Note that sinfo "%P" prints "*" after default partition name

---
 doc/man/man1/sinfo.1 | 2 +-
 src/sinfo/print.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/man/man1/sinfo.1 b/doc/man/man1/sinfo.1
index d5208999dc0..fc52f94e241 100644
--- a/doc/man/man1/sinfo.1
+++ b/doc/man/man1/sinfo.1
@@ -182,7 +182,7 @@ List of node names
 List of node communication addresses
 .TP
 \fB%P\fR
-Partition name
+Partition name followed by "*" for the default partition
 .TP
 \fB%r\fR
 Only user root may initiate jobs, "yes" or "no"
diff --git a/src/sinfo/print.c b/src/sinfo/print.c
index 77ffeeef4cb..669cc2f9343 100644
--- a/src/sinfo/print.c
+++ b/src/sinfo/print.c
@@ -716,7 +716,7 @@ int _print_partition(sinfo_data_t * sinfo_data, int width,
 			char *tmp;
 			tmp = xstrdup(sinfo_data->part_info->name);
 			if (sinfo_data->part_info->flags & PART_FLAG_DEFAULT) {
-				if (strlen(tmp) < width)
+				if ( (strlen(tmp) < width) || (width == 0) )
 					xstrcat(tmp, "*");
 				else if (width > 0)
 					tmp[width-1] = '*';
-- 
GitLab