[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [476] trunk



Revision: 476
          http://svn.sourceforge.net/ledger-smb/?rev=476&view=rev
Author:   einhverfr
Date:     2006-11-02 20:48:39 -0800 (Thu, 02 Nov 2006)

Log Message:
-----------
Fixing default bug

Modified Paths:
--------------
    trunk/LedgerSMB/Form.pm
    trunk/utils/cli/ledgersmb_cli.pl

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2006-11-03 03:29:04 UTC (rev 475)
+++ trunk/LedgerSMB/Form.pm	2006-11-03 04:48:39 UTC (rev 476)
@@ -2765,7 +2765,7 @@
 		 WHERE setting_key = ? FOR UPDATE|;
 	$sth = $dbh->prepare($query);
 	$sth->execute($fld);
-	($_) = $dbh->selectrow_array($query);
+	($_) = $sth->fetchrow_array($query);
 
 	$_ = "0" unless $_;
 

Modified: trunk/utils/cli/ledgersmb_cli.pl
===================================================================
--- trunk/utils/cli/ledgersmb_cli.pl	2006-11-03 03:29:04 UTC (rev 475)
+++ trunk/utils/cli/ledgersmb_cli.pl	2006-11-03 04:48:39 UTC (rev 476)
@@ -82,12 +82,15 @@
 	startrule : instruction
 
 _END_SYNTAX_
+
  $::RD_HINT = 1;
  $::RD_ERRORS = 1; # Make sure the parser dies when it encounters an error
  $::RD_WARN   = 1; # Enable warnings. This will warn on unused rules &c.`
 #$::RD_TRACE = 1;
+my @loopstack;
+my $loopindex;
 my $stackref;
-my @loopstack;
+my @control_stack;
 
 push @loopstack, $form;
 
@@ -122,8 +125,18 @@
 
 sub push_loop {
 	my $key = shift;
+	my $is_hash = 0;
+	if (ref($stackref->{$key}) =~ /HASH/){
+		$is_hash = 1;
+	elsif (ref ($stackref->{$key}) !~ /ARRAY/){
+		print STDERR "Warning:  Must loop through array or hash.";
+	}
 	push @loopstack, \$stackref->{$key};
-	$stackref = \$loopstack[$#loopstack];
+	push @controlstack, 
+		{ "key" => $key, 
+		'index' => 0,
+		'linenum' => $#linestack,
+		is_hash => $is_hash };
 }
 
 sub pop_loop {
@@ -152,7 +165,12 @@
 
 my $scriptparse = new Parse::RecDescent($syntax);
 
+
+$loopindex = 0;
+my @linestack;
+
 while ($line = <>){
+	push @linestack, $line;
 	if ($if_count){
 		if ($line =~ /^\s*IF\s/){
 			++$if_count;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.