summaryrefslogtreecommitdiffstats
path: root/fdisk/fdisksgilabel.c
diff options
context:
space:
mode:
authorFrancesco Cosoleto2011-12-15 20:02:39 +0100
committerKarel Zak2011-12-16 14:04:00 +0100
commit883c5f715833b32137eac78f63b3517e9d1bda17 (patch)
treeabf5ce05952ebe34ecf4b73325547f67c7dea563 /fdisk/fdisksgilabel.c
parentfdisk: remove possibly_osf_label variable that is only assigned (diff)
downloadkernel-qcow2-util-linux-883c5f715833b32137eac78f63b3517e9d1bda17.tar.gz
kernel-qcow2-util-linux-883c5f715833b32137eac78f63b3517e9d1bda17.tar.xz
kernel-qcow2-util-linux-883c5f715833b32137eac78f63b3517e9d1bda17.zip
fdisk: move code for renaming SGI bootfile to SGI module
This moves the code for renaming SGI bootfile from command_prompt() to sgi_set_bootfilename() function. Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
Diffstat (limited to 'fdisk/fdisksgilabel.c')
-rw-r--r--fdisk/fdisksgilabel.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/fdisk/fdisksgilabel.c b/fdisk/fdisksgilabel.c
index 002688a4c..b432b1344 100644
--- a/fdisk/fdisksgilabel.c
+++ b/fdisk/fdisksgilabel.c
@@ -316,20 +316,21 @@ sgi_check_bootfile(const char* aFile) {
return 0; /* filename did not change */
}
-const char *
-sgi_get_bootfile(void) {
- return (char *) sgilabel->boot_file;
-}
-
void
-sgi_set_bootfile(const char* aFile) {
+sgi_set_bootfile(void)
+{
+ printf(_("\nThe current boot file is: %s\n"), sgilabel->boot_file);
+ if (read_chars(_("Please enter the name of the new boot file: ")) == '\n') {
+ printf(_("Boot file unchanged\n"));
+ return;
+ }
- if (sgi_check_bootfile(aFile)) {
+ if (sgi_check_bootfile(line_ptr)) {
size_t i = 0;
while (i < 16) {
- if ((aFile[i] != '\n') /* in principle caught again by next line */
- && (strlen(aFile) > i))
- sgilabel->boot_file[i] = aFile[i];
+ if ((line_ptr[i] != '\n') /* in principle caught again by next line */
+ && (strlen(line_ptr) > i))
+ sgilabel->boot_file[i] = line_ptr[i];
else
sgilabel->boot_file[i] = 0;
i++;