Description: Fix the short-circuit boolean operators
Author: Rafael Laboissiere <rafael@laboissiere.net>
Last-Update: 2012-03-31

--- plplot-5.9.9.orig/bindings/octave/PLplot/figure.m
+++ plplot-5.9.9/bindings/octave/PLplot/figure.m
@@ -183,7 +183,7 @@ function [n, driver, intp]= figure (n, d
       endif
 
       ## the tk stuff
-      if (0 & strcmp("tk", sprintf("%s",plgdev')))
+      if (0 && strcmp("tk", sprintf("%s",plgdev')))
 	if (! exist("tk_start") && nargin == 6)
 	  error("Can't use this Tk feature of PLplot until tk_octave \
                  is installed!\n")
@@ -234,7 +234,7 @@ function [n, driver, intp]= figure (n, d
       #pladv(0);
       #plflush;pleop;
       
-      if ( 0 & exist("__tk_name") & (strcmp("tk", sprintf("%s",plgdev'))))
+      if ( 0 && exist("__tk_name") && (strcmp("tk", sprintf("%s",plgdev'))))
 	eval(tk_receive(1));
 	__pl.intp = __pl_matstr(__pl.intp, intp, strm);	# tk interpreter name					
 	unlink(init_file);
--- plplot-5.9.9.orig/bindings/octave/PLplot/shade.m
+++ plplot-5.9.9/bindings/octave/PLplot/shade.m
@@ -52,7 +52,7 @@ function shade(x, y, z, levels, cont )
     levels = 2;
   endif
 
-  if (rows(x) > 1 & columns(x) > 1 & rows(y) > 1 & columns(y) > 1)
+  if (rows(x) > 1 && columns(x) > 1 && rows(y) > 1 && columns(y) > 1)
     xymat = 1;
   else
     xymat = 0;
@@ -76,7 +76,7 @@ function shade(x, y, z, levels, cont )
     if (__pl.axis_st(strm))
       xm = __pl.axis(strm,1); xM = __pl.axis(strm,2);
       if (xymat == 0)
-        ix = find(x >= xm & x <= xM); 
+        ix = find(x >= xm && x <= xM); 
         x=x(ix); z=z(:,ix);
         xmm = min(x); 
       endif
@@ -84,7 +84,7 @@ function shade(x, y, z, levels, cont )
       if (length(__pl.axis(strm,:)) >= 4)	
 	ym = __pl.axis(strm,3); yM = __pl.axis(strm,4);
         if (xymat == 0)
-	  iy = find(y >= ym & y <= yM);
+	  iy = find(y >= ym && y <= yM);
 	  y=y(iy); z=z(iy,:);
 	  ymm = min(y);
         endif
@@ -113,8 +113,8 @@ function shade(x, y, z, levels, cont )
     ymm = ym = __pl.axis(strm,3); yM = __pl.axis(strm,4);
     zm = __pl.axis(strm,5); zM = __pl.axis(strm,6);
     if (xymat == 0)
-      ix = find(x >= xm & x <= xM);
-      iy = find(y >= ym & y <= yM);
+      ix = find(x >= xm && x <= xM);
+      iy = find(y >= ym && y <= yM);
       z = z( iy, ix );
       x = x( ix );
       y = y( iy );
@@ -122,10 +122,10 @@ function shade(x, y, z, levels, cont )
   endif
 
   maxx = max(max(x)); maxy = max(max(y)); minx = min(min(x)); miny = min(min(y));
-  if (columns(x)>1 & rows(x) == 1)
+  if (columns(x)>1 && rows(x) == 1)
     x = x';
   endif
-  if (columns(y)>1 & rows(y) == 1)
+  if (columns(y)>1 && rows(y) == 1)
     y = y';
   endif
     
@@ -154,7 +154,7 @@ function shade(x, y, z, levels, cont )
 	      cont_color, cont_width, max_color, max_width, 1, x, y);
     endfor
   else
-    if (columns(x) == 1 & columns(y) == 1)
+    if (columns(x) == 1 && columns(y) == 1)
       plshades1(z', minx, maxx, miny, maxy, 
 	     clevel', 1, cont_color, cont_width, 1, x, y);
     else
--- plplot-5.9.9.orig/bindings/octave/PLplot/plot3.m
+++ plplot-5.9.9/bindings/octave/PLplot/plot3.m
@@ -32,11 +32,11 @@ function plot3 (x, y, z, fmt)
   global __pl
   strm = __pl_init;
 
-  if (nargin != 4 & nargin != 3)
+  if (nargin != 4 && nargin != 3)
     error("plot3: not yet.\n");
   endif
 
-  if (isvector(x) & isvector(y) & isvector(y))
+  if (isvector(x) && isvector(y) && isvector(y))
     
     if (nargin == 3)
       fmt = "-r";
@@ -44,7 +44,7 @@ function plot3 (x, y, z, fmt)
 
     __pl_plot3(x, y, z, fmt);
     
-  elseif (ismatrix(x) & ismatrix(y) & ismatrix(z))
+  elseif (ismatrix(x) && ismatrix(y) && ismatrix(z))
     
     if (!common_size(x,y,z))
 
--- plplot-5.9.9.orig/bindings/octave/PLplot/fill.m
+++ plplot-5.9.9/bindings/octave/PLplot/fill.m
@@ -45,10 +45,10 @@ function fill(x, y, c)
     error("fill: not yet.\n");
   endif
 
-  if (isvector(x) & isvector(y))
+  if (isvector(x) && isvector(y))
     __pl_fill(x, y, c);
     
-  elseif (ismatrix(x) | ismatrix(y))
+  elseif (ismatrix(x) || ismatrix(y))
 
     if (rows(x) == rows(y))
       if (isvector(x))
--- plplot-5.9.9.orig/bindings/octave/PLplot/save_fig.m
+++ plplot-5.9.9/bindings/octave/PLplot/save_fig.m
@@ -88,7 +88,7 @@ function save_fig(file, device, rev)
 
   device = dev;
 
-  if (nargin >= 1 && ischar(device) & ischar(file))
+  if (nargin >= 1 && ischar(device) && ischar(file))
     
     to_prt = 0;
     if (strcmp(file,"|lp"))	# special output file, printer!
@@ -97,7 +97,7 @@ function save_fig(file, device, rev)
       fclose(fp);
     elseif (file(1) == '~')
       file = tilde_expand(file);
-    elseif (exist("FIGDIR") & file(1) != '/' & file(1) != '.')
+    elseif (exist("FIGDIR") && file(1) != '/' && file(1) != '.')
       file = [FIGDIR, '/', file];
     endif
 
--- plplot-5.9.9.orig/bindings/octave/PLplot/support/__pl_logplotit.m
+++ plplot-5.9.9/bindings/octave/PLplot/support/__pl_logplotit.m
@@ -39,7 +39,7 @@ function __pl_logplotit
       endif
     elseif (__pl.type(strm) == 30)
       if (any(y <= 0) || any(x <= 0))
-	expr = "ix = find(y > 0 & x > 0);";
+	expr = "ix = find(y > 0 && x > 0);";
       else
 	break;
       endif
--- plplot-5.9.9.orig/bindings/octave/PLplot/support/__pl_fill.m
+++ plplot-5.9.9/bindings/octave/PLplot/support/__pl_fill.m
@@ -31,7 +31,7 @@ function __pl_fill(x, y, c)
 
   strm = plgstrm+1;
 
-  if (isvector(x) & isvector(y))
+  if (isvector(x) && isvector(y))
     if (columns(x) != 1)
       x = x';
       y = y';
@@ -55,7 +55,7 @@ function __pl_fill(x, y, c)
       __pl_plenv(min(x), max(x), min(y), max(y), 0, -1);
     endif
     
-    if (ischar(c) & length(c) == 1)
+    if (ischar(c) && length(c) == 1)
       ## map to plplot color
       coln = ['r','g','b','c','m','y','w','k'];
       coli = [2, 4, 10, 12, 14, 3, 16, 1];
@@ -67,11 +67,11 @@ function __pl_fill(x, y, c)
       else
 	plcol1(c);
       endif
-    elseif (isvector(c) & length(c) == 3)
+    elseif (isvector(c) && length(c) == 3)
       ## FIXME -- color 15 became permanently set!
       plscol0(15, c(1), c(2), c(3));
       plcol0(15);
-    elseif (isvector(c) & length(x) == length(x))
+    elseif (isvector(c) && length(x) == length(x))
       
       ## If C is a vector the same length as X and Y, its elements are
       ## scaled by CAXIS and used as indices into the current COLORMAP to
--- plplot-5.9.9.orig/bindings/octave/PLplot/support/__pl_plot3.m
+++ plplot-5.9.9/bindings/octave/PLplot/support/__pl_plot3.m
@@ -20,7 +20,7 @@ function __pl_plot3(x, y, z, c)
 
   strm = plgstrm+1;
 
-  if (isvector(x) & isvector(y) & isvector(z))
+  if (isvector(x) && isvector(y) && isvector(z))
 
     if (columns(x) != 1)
       x = x';
--- plplot-5.9.9.orig/bindings/octave/PLplot/support/__pl_matstr.m
+++ plplot-5.9.9/bindings/octave/PLplot/support/__pl_matstr.m
@@ -20,7 +20,7 @@
 function out = __pl_matstr(mat, str, n)
 
   ## Octave damned string arrays are defective!
-  if (ischar(str) & ischar(mat) & rows(str) == 1)
+  if (ischar(str) && ischar(mat) && rows(str) == 1)
     if (isempty(mat))
       out(n,:) = str;
     else
