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

Bug#123926: /instmnt, directory browsing, /target, fun continues



jaqque and I looked at this some this evening and it looks like a
solution is in the works.  I think he's going to take the ball from
here on as he's pumped to tackle choose_medium.c.

One interesting change that makes life better for everyone is to fix
the directory browser in boxes.c so it tells you the whole truth.  As
written if you are browsing under '/target' you aren't told that you
are under '/target' and you can't get to '/' without doing some
unintuitive and obscure key strokes (you have to enter '/..' in the
text box, it is impossible to get there from the browser).  In fact,
the directory browser makes it look like you are browsing '/' when you
are actually browsing '/instmnt' or '/target'.  

The code was originally written so that we could lock the user in
under /target or /instmnt.  The idea was that it would be less
confusing, but as #123926 indicates, it is still confusing and even
worthy of a serious bug.  I'm suggesting we take the locking out and
give the user more info.  In the case of a situation like #123926 the
user would be able to browse back up to /win and get the needed files.

To arrive at this patch I basically did :
cvs diff -u -r1.41 -r1.42 boxes.c 
and removed the chunks that locked the user in, FYI.

This along with fixing choose_medium.c so that '/target' is always
the prefix for 'Already mounted filesystems' and '/instmnt' is always
the prefix for unmounted partitions will, I think fix this all.
jaqque indicated he'd have some time tomorrow to fix this last part.

Any objections?

-David


Index: boxes.c
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/boxes.c,v
retrieving revision 1.60
diff -u -r1.60 boxes.c
--- boxes.c	2001/12/11 23:27:47	1.60
+++ boxes.c	2001/12/26 07:25:31
@@ -756,7 +756,6 @@
     char *tempo = malloc (PATH_MAX);
     char mydir[PATH_MAX];
     int result;
-    char *cp;
     struct stat statbuf;
 
     result = DLG_ERROR;
@@ -802,9 +801,7 @@
 
                     newtListboxAddEntry (list, "/", root);
 
-                    for (++index, spaces = 0, p = tempo + 1 + strlen (prefix) ;
-			 (q = strchr (p, '/')) != NULL ;
-			 ++index, ++spaces, p = q + 1)
+                    for (++index, spaces = 1, p = tempo + 1 ; (q = strchr (p, '/')) != NULL ; ++index, ++spaces, p = q + 1)
                     {
                         size_t l = q - p;
 
@@ -960,8 +957,6 @@
 
             if (node != NULL)
                 strcpy (tempo, node->value);
-	    if (!strcmp (tempo, "/") && strcmp (prefix, ""))
-	      sprintf (tempo, "%s", prefix);
 
             while (root != NULL)
             {
@@ -978,10 +973,7 @@
 
         } while (!done);
 
-	cp = tempo;
-	cp += strlen (prefix);
-
-        strcpy (buf, cp);
+        strcpy (buf, tempo);
     }
 
     free (tempo);



Reply to: