Index: Singular/LIB/normal.lib
===================================================================
--- Singular/LIB/normal.lib	(revision 3bc27a35af1aa573f7b8b110c0fda5e484414166)
+++ Singular/LIB/normal.lib	(revision dc2e7d521c529b1881baa1cbaeb461c0e7d3c88c)
@@ -2156,5 +2156,5 @@
 
 proc genus(ideal I,list #)
-"USAGE:   genus(i) or genus(i,1); I a 1-dimensional ideal
+"USAGE:   genus(I) or genus(I,<option>); I a 1-dimensional ideal
 RETURN:  an integer, the geometric genus p_g = p_a - delta of the projective
          curve defined by i, where p_a is the arithmetic genus.
@@ -2162,6 +2162,7 @@
          i.e. dim(R'/R), R' the normalization of the local ring R of the
          singularity. @*
-         genus(i,1) uses the normalization to compute delta. Usually genus(i,1)
-         is slower than genus(i) but sometimes not.
+         genus(I,"nor") uses the normalization to compute delta. Usually genus(I,"nor")
+         is slower than genus(I) but sometimes not. @*
+         genus(I,"pri") starts with a primary decompsition.
 EXAMPLE: example genus; shows an example
 "
@@ -2169,6 +2170,16 @@
    int w = printlevel-voice+2;  // w=printlevel (default: w=0)
 
+   int ono,rpr,ll;
+   if(size(#)>0)
+   {
+     if(typeof(#[1])=="string")
+     {
+        if(#[1]=="nor"){ono=1;}
+        if(#[1]=="pri"){rpr=1;}
+     }
+     else { ERROR("invalid option for genus");}
+   }
    def R0=basering;
-   if(char(basering)>0)
+   if((char(basering)>0)||(ono))
    {
      def R1=changeord(list(list("dp",1:nvars(basering))));
@@ -2198,8 +2209,35 @@
        J=std(J);
      }
-     int pa=1-hilbPoly(J)[1];
-     pa=pa-deltaP(J);
+
+     list LL=normal(J,"prim");
+     int pa,i;
+     for(i=1;i<=size(LL[1]);i++)
+     {
+        def T=LL[1][i];
+        setring T;
+        pa=pa-hilbPoly(std(norid))[1];
+        setring S;
+        kill T;
+     }
+     pa=pa+1;
      setring R0;
      return(pa);
+   }
+   if(!rpr)
+   {
+      list LZ=minAssGTZ(I);
+      if(size(LZ)>1)
+      {
+         int p_g;
+         for(ll=1;ll<=size(LZ);ll++)
+         {
+            p_g=p_g+genus(LZ[ll],"pri")-1;
+         }
+         return(p_g+1);
+      }
+      else
+      {
+         I=LZ[1];
+      }
    }
    I=std(I);
@@ -2432,13 +2470,4 @@
    map sigma=S,var(1),var(2),1;
    ideal I=sigma(F);
-
-   if(size(#)!=0)
-   {                              //uses the normalization to compute delta
-      list nor=normal(I,"withDelta");
-      delt=nor[size(nor)][2];
-      genus=genus-delt-deltainf;
-      setring R0;
-      return(genus);
-   }
 
    ideal I1=jacob(I);
Index: Tst/Short/bug_532_s.res.gz.uu
===================================================================
--- Tst/Short/bug_532_s.res.gz.uu	(revision 3bc27a35af1aa573f7b8b110c0fda5e484414166)
+++ Tst/Short/bug_532_s.res.gz.uu	(revision dc2e7d521c529b1881baa1cbaeb461c0e7d3c88c)
@@ -1,11 +1,12 @@
-begin 664 bug_532_s.res.gz
-M'XL(")_>H5(``V)U9U\U,S)?<RYR97,`39%1:\(P%(7?^RL.96`R:C76;E-I
-M'\;V(`P'NF<EKK$+U%3:B-*Q_[ZDE=2\).1^]YSDW,W7VW(%@*48C7#Y$0I"
-M\7TA58X+KQ3*DY:E"E"+_,#/A>Z8;UZTR"`7ZEP3&3`Z\#8WK4EHM;I&XEL5
-MGR[@RE'8GZ<A/I:O\'6MPT+N_86KQ"G,Y4XJJ0E=>'9'FF)_SG=Q--G5H1*7
-ML-9<NXZGM-=]OO-X"6&7\2&^*JLC+UHKVGO-^DXV[NC*_JY"@G%`FN!*@^SD
-M>&;"LDMF@A>0!FJV\;#91L/F\6I.U^VL9R<=>\O)YC!SM:BK9?)(4.O,E&$`
-MDUW"@"1M4T:?,&2-0N12RR/7PF-.9WKW_KA[OSR`J%*#.&<DB=."$:,4^,7[
-K>OVY)K[-%5)AU>8SGW<@M7/[<])W`3,3L!V/'8`!F>$>O'__/`,D3`(`````
+begin 644 bug_532_s.res.gz
+M'XL("-L]J%(``V)U9U\U,S)?<RYR97,`G9)1:\(P%(7?^RL.86`Z:K36ZE3:
+MA[$]#(8#W;,2U]H%:BIM1.G8?U_2NM3'L;PTY'[W'.ZY7;\_O2P!^#$&`YP_
+M4XE4\ETN9(8S+R6*HQ*%]%"EV9Z?<M4R'SQOD%Z6RE-%A>>[/6=]U1HQH]4V
+M4F)4B+N`+0>LNX\97E\>052E6"YV9&$K80S]N!52*.HN'/-%'&-WRK9A,-I6
+M3*9G5BFN;,<D[G2G-QX/#.9H'TID41YXWEBYG=>LZ_2'+5V:Z4I$&'JT]BZN
+MEQPM[^NPS!%)RG,(#=6;L%]O@GY]?]&WRV;6L:.6O>9D<IC96M#6$G&@J%2B
+MR]"`SB[R@2AN4O[M]!AC+D2%/,V$$@>N4L>W2N.;"<)V`K$'E84"M=Z((JL&
+M<BP%T7XN\(7GU>IM18E)%T)BV:0TG[>P:[;W;>4G\9_D==+_DI_>3*(W9_X!
+1LV4-^IJ[<WX`Z73[3K$"````
 `
 end
Index: Tst/Short/bug_532_s.tst
===================================================================
--- Tst/Short/bug_532_s.tst	(revision 3bc27a35af1aa573f7b8b110c0fda5e484414166)
+++ Tst/Short/bug_532_s.tst	(revision dc2e7d521c529b1881baa1cbaeb461c0e7d3c88c)
@@ -11,7 +11,8 @@
     ideal i = z^5-z^3-z*x^5-x^9;
     genus(i); 
-    dim( std(i) ); // =1  => call genus(i,1) is legitimate
+    dim( std(i) ); // =1  => call genus(i,...) is legitimate
 
-    if (not ( genus(i) == genus(i, 1) ))  { ERROR(" bug in Normal::genus()"); }
+    if (not ( genus(i) == genus(i, "pri") ))  { ERROR(" bug in Normal::genus()"); }
+    if (not ( genus(i) == genus(i, "nor") ))  { ERROR(" bug in Normal::genus()"); }
 
 tst_status(1); $
Index: bug_532_s.stat
===================================================================
--- bug_532_s.stat	(revision 3bc27a35af1aa573f7b8b110c0fda5e484414166)
+++ bug_532_s.stat	(revision dc2e7d521c529b1881baa1cbaeb461c0e7d3c88c)
@@ -1,4 +1,4 @@
-1 >> tst_memory_0 :: 1386345906:3170:3-1-7:ix86-Linux:mamawutz:406104
-1 >> tst_memory_1 :: 1386345906:3170:3-1-7:ix86-Linux:mamawutz:2490368
-1 >> tst_memory_2 :: 1386345906:3170:3-1-7:ix86-Linux:mamawutz:2583456
-1 >> tst_timer_1 :: 1386345906:3170:3-1-7:ix86-Linux:mamawutz:39
+1 >> tst_memory_0 :: 1386757595:3170:3-1-7:ix86-Linux:mamawutz:448676
+1 >> tst_memory_1 :: 1386757595:3170:3-1-7:ix86-Linux:mamawutz:2531328
+1 >> tst_memory_2 :: 1386757595:3170:3-1-7:ix86-Linux:mamawutz:2670592
+1 >> tst_timer_1 :: 1386757595:3170:3-1-7:ix86-Linux:mamawutz:100
