patch-pre2.0.4 linux/fs/isofs/rock.c

Next file: linux/fs/locks.c
Previous file: linux/drivers/scsi/scsi.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file pre2.0.3/linux/fs/isofs/rock.c linux/fs/isofs/rock.c
@@ -333,6 +333,7 @@
       case SIG('S','L'):
 	{int slen;
 	 struct SL_component * slp;
+	 struct SL_component * oldslp;
 	 slen = rr->len - 5;
 	 slp = &rr->u.SL.link;
 	 inode->i_size = symlink_len;
@@ -356,10 +357,20 @@
 	     printk("Symlink component flag not implemented\n");
 	   };
 	   slen -= slp->len + 2;
+	   oldslp = slp;
 	   slp = (struct SL_component *) (((char *) slp) + slp->len + 2);
 
-	   if(slen < 2) break;
-	   if(!rootflag) inode->i_size += 1;
+	   if(slen < 2) {
+	     if(    ((rr->u.SL.flags & 1) != 0) 
+		    && ((oldslp->flags & 1) == 0) ) inode->i_size += 1;
+	     break;
+	   }
+
+	   /*
+	    * If this component record isnt continued, then append a '/'.
+	    */
+	   if(   (!rootflag)
+		 && ((oldslp->flags & 1) == 0) ) inode->i_size += 1;
 	 }
 	}
 	symlink_len = inode->i_size;
@@ -475,6 +486,7 @@
       break;
     case SIG('S','L'):
       {int slen;
+       struct SL_component * oldslp;
        struct SL_component * slp;
        slen = rr->len - 5;
        slp = &rr->u.SL.link;
@@ -503,10 +515,25 @@
 	   printk("Symlink component flag not implemented (%d)\n",slen);
 	 };
 	 slen -= slp->len + 2;
+	 oldslp = slp;
 	 slp = (struct SL_component *) (((char *) slp) + slp->len + 2);
 
-	 if(slen < 2) break;
-	 if(!rootflag) strcat(rpnt,"/");
+	 if(slen < 2) {
+	   /*
+	    * If there is another SL record, and this component record
+	    * isn't continued, then add a slash.
+	    */
+	   if(    ((rr->u.SL.flags & 1) != 0) 
+	       && ((oldslp->flags & 1) == 0) ) strcat(rpnt,"/");
+	   break;
+	 }
+
+	 /*
+	  * If this component record isnt continued, then append a '/'.
+	  */
+	 if(   (!rootflag)
+	    && ((oldslp->flags & 1) == 0) ) strcat(rpnt,"/");
+
        };
        break;
      case SIG('C','E'):

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this