diff netinstall/install.cc @ 819:6504113e7c2d

[xemacs-hg @ 2002-04-25 18:03:23 by andyp] sync up windows branch from 21.4
author andyp
date Thu, 25 Apr 2002 18:04:24 +0000
parents a307f9a2021d
children
line wrap: on
line diff
--- a/netinstall/install.cc	Thu Apr 25 06:09:18 2002 +0000
+++ b/netinstall/install.cc	Thu Apr 25 18:04:24 2002 +0000
@@ -282,6 +282,7 @@
   for (cp=local; *cp; cp++)
     if (*cp == '/' || *cp == '\\' || *cp == ':')
       base = cp+1;
+
   SetWindowText (ins_pkgname, base);
 
   if (!exists (local) && exists (base))
@@ -315,14 +316,27 @@
   tar_open (local);
   while ((fn = tar_next_file ()))
     {
-      char *dest_file;
+      char *dest_file, *disp_file;
+      int len;
 
       if (lst)
 	fprintf (lst, "%s\n", fn);
 
       dest_file = map_filename (fn, type);
+      
+      // The installer uses a variable width font. Assume roughly 32 chars
+      // will fit and munge the file accordingly.
+#define MAX_DISP_SIZE 50
+      disp_file = strdup(dest_file);
+      if ((len = strlen(dest_file)) > MAX_DISP_SIZE) {
+	disp_file += (len - MAX_DISP_SIZE);
+	disp_file[0] = '.';
+	disp_file[1] = '.';
+	disp_file[2] = '.';
+      }
+#undef MAX_DISP_SIZE
+      SetWindowText (ins_filename, disp_file);
 
-      SetWindowText (ins_filename, dest_file);
       log (LOG_BABBLE, "Installing file %s", dest_file);
       if (tar_read_file (dest_file) != 0)
 	{