Browse Source

This fixes some variable confusion where $changed_text .. the full path and

name of the template was being confused with the edited part of the template,
also called $changed_text, now it is called $changed_text_from_template, problem
solved.
master
freesource 24 years ago
parent
commit
6112a38c93
  1. 14
      BootRoot/YardBox.pm

14
BootRoot/YardBox.pm

@ -39,7 +39,7 @@ my $error;
my ($continue_button,$close_button,$save_button); my ($continue_button,$close_button,$save_button);
my($check,$dep,$space,$create,$test); my($check,$dep,$space,$create,$test);
my($filename,$filesystem_size,$kernel,$template_dir,$template,$tmp,$mnt); my($filename,$filesystem_size,$kernel,$template_dir,$template,$tmp,$mnt);
my ($text, $changed_text); my ($text, $changed_text, $changed_text_from_template);
my $save_as; my $save_as;
my $filesystem_type = "ext2"; my $filesystem_type = "ext2";
@ -218,7 +218,7 @@ sub yard {
return "ERROR"if $error && $error eq "ERROR"; return "ERROR"if $error && $error eq "ERROR";
my @template = <CONTENTS>; my @template = <CONTENTS>;
close(CONTENTS); close(CONTENTS);
$changed_text = join("",@template); $changed_text_from_template = join("",@template);
yard_box(); yard_box();
#} #}
@ -874,7 +874,7 @@ sub yard_box {
$text->set_editable($true); $text->set_editable($true);
$text->signal_connect("activate", sub { $text->signal_connect("activate", sub {
my $new_length = $text->get_length(); my $new_length = $text->get_length();
$changed_text = $text->get_chars(0,$new_length); $changed_text_from_template = $text->get_chars(0,$new_length);
} ); } );
$table->attach( $text, 0, 1, 0, 1, $table->attach( $text, 0, 1, 0, 1,
[ 'expand', 'shrink', 'fill' ], [ 'expand', 'shrink', 'fill' ],
@ -884,7 +884,7 @@ sub yard_box {
$text->show(); $text->show();
$text->freeze(); $text->freeze();
$text->insert( undef, undef, undef, $changed_text); $text->insert( undef, undef, undef, $changed_text_from_template);
$text->thaw(); $text->thaw();
$start_length = $text->get_length(); $start_length = $text->get_length();
@ -998,7 +998,7 @@ sub saved {
open(NEW,">$new") or open(NEW,">$new") or
($error = error("gBootRoot: ERROR: Can't create $new")); ($error = error("gBootRoot: ERROR: Can't create $new"));
return if $error && $error eq "ERROR"; return if $error && $error eq "ERROR";
print NEW $changed_text; print NEW $changed_text_from_template;
close(NEW); close(NEW);
rename($new, "$template_dir$template") or rename($new, "$template_dir$template") or
($error = error("gBootRoot: ERROR: Can't rename $new to " . ($error = error("gBootRoot: ERROR: Can't rename $new to " .
@ -1071,7 +1071,7 @@ sub save_as {
# Here's where we get to undef Yard variable and start over at # Here's where we get to undef Yard variable and start over at
# check # check
my $new = "$template_dir$new_template"; my $new = "$template_dir$new_template";
print "$new && $template_dir$template\n";
if (!basename($new)) { if (!basename($new)) {
if ( file_mode("$template_dir$template") =~ /l/ ) { if ( file_mode("$template_dir$template") =~ /l/ ) {
error_window("gBootRoot: ERROR: $template_dir$template is not " . error_window("gBootRoot: ERROR: $template_dir$template is not " .
@ -1091,7 +1091,7 @@ sub save_as {
open(NEW,">$new") or open(NEW,">$new") or
($error = error("gBootRoot: ERROR: Can't create $new")); ($error = error("gBootRoot: ERROR: Can't create $new"));
return if $error && $error eq "ERROR"; return if $error && $error eq "ERROR";
print NEW $changed_text; print NEW $changed_text_from_template;
close(NEW); close(NEW);
$template = $new_template; $template = $new_template;

Loading…
Cancel
Save