home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume16 / lc / patch1 / lc.patch
Encoding:
Text File  |  1991-01-10  |  15.0 KB  |  528 lines

  1. diff -c ../lc.old/README ./README
  2. *** ../lc.old/README    Tue Jan  8 21:23:29 1991
  3. --- ./README    Tue Jan  8 21:22:27 1991
  4. ***************
  5. *** 1,23 ****
  6.   
  7.               LC
  8.   
  9. !         "@(#)README    1.3 9/7/90 Kent Landfield"
  10.   
  11.   This directory contains the source to lc. lc is much like the ls 
  12.   command except it separates the types of files into groups and then
  13.   displays located file names to the user is a columnar fashion. 
  14.   
  15. ! lc was initially implemented by myself after I became accustomed
  16. ! to the lc command on a Mark Williams Coherent system I was running back
  17. ! in 1984.  When I started moving to different systems I found that I did
  18. ! not like the lack of information, flexibility and the general display 
  19. ! that ls provided.  I have found that I am not the only one that has 
  20. ! become feed up with ls and its jumbled output. All the people here use 
  21. ! lc much more than they use ls. It is a locally well known fact that when
  22. ! a new machine comes into the house, the first local software that is put 
  23. ! on the machine is lc.  It is far from perfect but it is better than ls on 
  24. ! a general use basis.
  25.   
  26.   lc uses three different environment variables COLS, CDPATH, and LC
  27.   allowing you to customize how you wish lc to perform on a default 
  28.   basis. COLS is used to switch the column width between 80 and 132 
  29. --- 1,29 ----
  30.   
  31.               LC
  32.   
  33. !         "@(#)README    1.4 1/8/91 Kent Landfield"
  34.   
  35.   This directory contains the source to lc. lc is much like the ls 
  36.   command except it separates the types of files into groups and then
  37.   displays located file names to the user is a columnar fashion. 
  38.   
  39. ! "lc"'s history goes back to 1978 when it was originally developed at the
  40. ! University of Waterloo on a Honeywell 66/60 system. It became so popular 
  41. ! that it was ported to Waterloo's V7 Unix systems shortly thereafter.  
  42. ! This version is a complete re-implementation of lc and contains no 
  43. ! University of Waterloo code.
  44.   
  45. + This version of lc was initially implemented by myself after I became 
  46. + accustomed to the lc command on a Mark Williams Coherent system I was 
  47. + running back in 1984.  When I started moving to different systems I 
  48. + found that I did not like the lack of information, flexibility and the 
  49. + general display that ls provided.  I have found that I am not the only 
  50. + one that has become feed up with ls and its jumbled output. All the 
  51. + people here use lc much more than they use ls. It is a locally well 
  52. + known fact that when a new machine comes into the house, the first local 
  53. + software that is put on the machine is lc.  It is far from perfect but 
  54. + it is better than ls on a general use basis. 
  55.   lc uses three different environment variables COLS, CDPATH, and LC
  56.   allowing you to customize how you wish lc to perform on a default 
  57.   basis. COLS is used to switch the column width between 80 and 132 
  58. ***************
  59. *** 59,70 ****
  60.           -l      Mark symbolic links with '@'
  61.           -I      Suppress unresolved symbolic link messages.
  62.     
  63. !    The "only" options can not be combined.
  64.   
  65.      If there is no 'directory' specified, the current directory is used.
  66.   
  67.      Not all options are supported on every system. (e.g. no symbolic links
  68. !    on your system ? Options -s, -L or -l won't be available..)
  69.      If your system does not support shared memory name space entry files, 
  70.      then you cannot use the -m option...
  71.   
  72. --- 65,76 ----
  73.           -l      Mark symbolic links with '@'
  74.           -I      Suppress unresolved symbolic link messages.
  75.     
  76. !    The "only" options can be combined.
  77.   
  78.      If there is no 'directory' specified, the current directory is used.
  79.   
  80.      Not all options are supported on every system. (e.g. no symbolic links
  81. !    on your system ? Options -s, -I -L or -l won't be available..)
  82.      If your system does not support shared memory name space entry files, 
  83.      then you cannot use the -m option...
  84.   
  85. ***************
  86. *** 87,93 ****
  87. --- 93,102 ----
  88.         Tested with SunOS 4.0.3 on a Sparkstation 1 in 1989.
  89.         Tested with UTek on a Tektronix XD8810 in 1989.
  90.         Tested with AIX 3.+ on a Risc System/6000 in 1990.
  91. +       Ivan Fris added the ability to combine "only" options in 1990.
  92. +       Mike Peterson ported it to the Apollo Domain/OS SR10.2 in 1990.
  93.   
  94.   The following is a todo list that may get done someday...
  95.   
  96.   1. Port to all flavors of unix on all platforms. Lofty goal but
  97. ***************
  98. *** 95,101 ****
  99.   2. Need to modify lc so that one environment (or compile) option will
  100.      only let you see files you own or have access to.
  101.   3. Add spell checking code to CDPATH usage
  102. - 4. Allow combination of only options...
  103.                                                           
  104.                             *PLEASE!* 
  105.   If you have a problem, there's someone else out there who either has
  106. --- 104,109 ----
  107. ***************
  108. *** 102,108 ****
  109.   had or will have the same problem.  Please send all "lc" ideas, patches, 
  110.   etc to 
  111.   
  112. ! INTERNET: kent@sparky.IMD.Sterling.COM or UUCP: uunet!ssbell!sparky!kent
  113.   
  114.   so that I can continue to improve the functionality and portability of lc.
  115.   
  116. --- 110,116 ----
  117.   had or will have the same problem.  Please send all "lc" ideas, patches, 
  118.   etc to 
  119.   
  120. ! INTERNET: kent@sparky.IMD.Sterling.COM or UUCP: uunet!sparky!kent
  121.   
  122.   so that I can continue to improve the functionality and portability of lc.
  123.   
  124. diff -c ../lc.old/lc.1 ./lc.1
  125. *** ../lc.old/lc.1    Tue Jan  8 21:23:34 1991
  126. --- ./lc.1    Tue Jan  8 21:22:27 1991
  127. ***************
  128. *** 1,4 ****
  129. ! .\" @(#)lc.1    1.1 9/7/90 Kent Landfield;
  130.   .TH LC 1 "Usenet Source"
  131.   .SH NAME
  132.   .B lc 
  133. --- 1,4 ----
  134. ! .\" @(#)lc.1    1.2 1/8/91 Kent Landfield;
  135.   .TH LC 1 "Usenet Source"
  136.   .SH NAME
  137.   .B lc 
  138. ***************
  139. *** 46,52 ****
  140.   is used to switch the column width between 80 and 132 column display.
  141.   .PP
  142.   .B lc 
  143. ! has incorporated the minimal the spell checking routines found in the book,
  144.   The UNIX Programming Environment, by Brian Kernighan and Rob Pike.  
  145.   .PP
  146.   If the command line argument list contains more than one name, the 
  147. --- 46,52 ----
  148.   is used to switch the column width between 80 and 132 column display.
  149.   .PP
  150.   .B lc 
  151. ! has incorporated the minimal spell checking routines found in the book,
  152.   The UNIX Programming Environment, by Brian Kernighan and Rob Pike.  
  153.   .PP
  154.   If the command line argument list contains more than one name, the 
  155. ***************
  156. *** 127,133 ****
  157.   .IP "-1"
  158.   List files one per line instead of in columns.
  159.   .SH DIAGNOSTICS
  160. ! The "only" options can not be combined at this time.
  161.   .PP
  162.   The spell checking does not work when the CDPATH is searched for a
  163.   file or directory not found in the current directory.
  164. --- 127,133 ----
  165.   .IP "-1"
  166.   List files one per line instead of in columns.
  167.   .SH DIAGNOSTICS
  168. ! The "only" options can be combined.
  169.   .PP
  170.   The spell checking does not work when the CDPATH is searched for a
  171.   file or directory not found in the current directory.
  172. ***************
  173. *** 142,147 ****
  174.   .SH AUTHOR
  175.   Kent Landfield <kent@sparky.IMD.Sterling.COM>
  176.   .SH CREDITS
  177. ! Jeff Minnig <jeff@dsndata> and Rick Ohnemus <rick@sparky.IMD.Sterling.COM> 
  178. ! were a *great* help with this program at different stages of its development...
  179. ! Thanks!
  180. --- 142,160 ----
  181.   .SH AUTHOR
  182.   Kent Landfield <kent@sparky.IMD.Sterling.COM>
  183.   .SH CREDITS
  184. ! .nr
  185. ! Jeff Minnig <jeff@dsndata>, 
  186. ! .nf
  187. ! .nr
  188. ! Rick Ohnemus <rick@sparky.IMD.Sterling.COM>, 
  189. ! .nf
  190. ! .nr
  191. ! Mike Peterson <root@alchemy.chem.utoronto.ca> and
  192. ! .nf
  193. ! .nr
  194. ! Ivan Fris <neumann.une.oz.au!ivan> 
  195. ! .nf
  196. ! .nf
  197. ! were a *great* help with this program at different stages 
  198. ! of its development...  Thanks!
  199. diff -c ../lc.old/lc.c ./lc.c
  200. *** ../lc.old/lc.c    Tue Jan  8 21:23:31 1991
  201. --- ./lc.c    Tue Jan  8 21:20:38 1991
  202. ***************
  203. *** 48,54 ****
  204.   **               -l      Mark symbolic links with '@'
  205.   **               -I      Suppress unresolved symbolic link messages.
  206.   **
  207. ! ** The "only" options can not be combined.
  208.   ** If there is no 'directory' specified, the current directory is used.
  209.   ** Not all options are supported on every system. (e.g. no symbolic links
  210.   ** on your system ? Options -s, -L or -l won't be available..)
  211. --- 48,54 ----
  212.   **               -l      Mark symbolic links with '@'
  213.   **               -I      Suppress unresolved symbolic link messages.
  214.   **
  215. ! ** The "only" options can be combined.
  216.   ** If there is no 'directory' specified, the current directory is used.
  217.   ** Not all options are supported on every system. (e.g. no symbolic links
  218.   ** on your system ? Options -s, -L or -l won't be available..)
  219. ***************
  220. *** 70,79 ****
  221.   **      Tested with AmigaDOS 1.3 on an Amiga 1000 in 1989.
  222.   **      Tested with SunOS 4.0.3 on a Sparkstation 1 in 1989.
  223.   **      Tested with AIX 3.+ on a Risc System/6000 in 1990. 
  224.   **                                                               
  225.   */
  226.   #ifndef lint
  227. ! static char *sccsid = "@(#)lc.c    1.23 9/7/90  Kent Landfield";
  228.   #endif
  229.   
  230.   #include <stdio.h>
  231. --- 70,80 ----
  232.   **      Tested with AmigaDOS 1.3 on an Amiga 1000 in 1989.
  233.   **      Tested with SunOS 4.0.3 on a Sparkstation 1 in 1989.
  234.   **      Tested with AIX 3.+ on a Risc System/6000 in 1990. 
  235. + **      Ivan Fris added the ability to combine "only" options.
  236.   **                                                               
  237.   */
  238.   #ifndef lint
  239. ! static char *sccsid = "@(#)lc.c    1.25 1/2/91  Kent Landfield";
  240.   #endif
  241.   
  242.   #include <stdio.h>
  243. ***************
  244. *** 143,168 ****
  245.   #  define S_IXOTH       (S_IEXEC >> 6)
  246.   #endif
  247.   
  248. ! #define DIR_ONLY        1
  249. ! #define FILE_ONLY       2
  250.   #ifdef S_IFCHR
  251. ! #  define CHAR_ONLY     3
  252.   #endif
  253.   #ifdef S_IFBLK
  254. ! #  define BLOCK_ONLY    4
  255.   #endif
  256.   #ifdef S_IFIFO
  257. ! #  define FIFO_ONLY     5
  258.   #endif
  259.   #ifdef S_IFLNK
  260. ! #  define LNK_ONLY      6
  261.   #endif
  262.   #ifdef S_IFSOCK
  263. ! #  define SOCK_ONLY     7
  264.   #endif
  265.   #ifdef S_IFNAM
  266. ! #  define SEM_ONLY      8
  267. ! #  define SD_ONLY       9
  268.   #endif
  269.   
  270.   #ifdef BSD
  271. --- 144,169 ----
  272.   #  define S_IXOTH       (S_IEXEC >> 6)
  273.   #endif
  274.   
  275. ! #define DIR_ONLY        1<<0
  276. ! #define FILE_ONLY       1<<2
  277.   #ifdef S_IFCHR
  278. ! #  define CHAR_ONLY     1<<3
  279.   #endif
  280.   #ifdef S_IFBLK
  281. ! #  define BLOCK_ONLY    1<<4
  282.   #endif
  283.   #ifdef S_IFIFO
  284. ! #  define FIFO_ONLY     1<<5
  285.   #endif
  286.   #ifdef S_IFLNK
  287. ! #  define LNK_ONLY      1<<6
  288.   #endif
  289.   #ifdef S_IFSOCK
  290. ! #  define SOCK_ONLY     1<<7
  291.   #endif
  292.   #ifdef S_IFNAM
  293. ! #  define SEM_ONLY      1<<8
  294. ! #  define SD_ONLY       1<<9
  295.   #endif
  296.   
  297.   #ifdef BSD
  298. ***************
  299. *** 499,504 ****
  300. --- 500,508 ----
  301.                 ind++;
  302.            }
  303.            *frmt = '\0';
  304. +          while (*--frmt == ' ')  /* strip trailing blanks */
  305. +              *frmt = '\0';
  306. +         
  307.            (void) puts(out_str);
  308.       }
  309.       return (ind);
  310. ***************
  311. *** 576,582 ****
  312.   
  313.       Current = 0;
  314.   
  315. !     if (Lnks.num > 0 && (Disp_links == TRUE || Only == LNK_ONLY)) {
  316.           ssing = Single;
  317.           Single = TRUE;
  318.           Current = LNK_ONLY;
  319. --- 580,586 ----
  320.   
  321.       Current = 0;
  322.   
  323. !     if (Lnks.num > 0 && (Disp_links == TRUE || Only & LNK_ONLY)) {
  324.           ssing = Single;
  325.           Single = TRUE;
  326.           Current = LNK_ONLY;
  327. ***************
  328. *** 586,622 ****
  329.   #endif
  330.   
  331.   #ifdef S_IFSOCK
  332. !     if (Socks.num > 0 && (Only == 0 || Only == SOCK_ONLY))
  333.           flag = pr_info("Sockets: ", &Socks, flag, Sort_wanted);
  334.   #endif
  335.   
  336.   #ifdef S_IFNAM
  337. !     if (Sems.num > 0 && (Only == 0 || Only == SEM_ONLY))
  338.           flag = pr_info("Semaphore Files: ", &Sems, flag, Sort_wanted);
  339.   
  340. !     if (Sds.num > 0 && (Only == 0 || Only == SD_ONLY))
  341.           flag = pr_info("Shared Data Files: ", &Sds, flag, Sort_wanted);
  342.   #endif
  343.   
  344.   #ifdef S_IFIFO
  345. !     if (Fifos.num > 0 && (Only == 0 || Only == FIFO_ONLY))
  346.           flag = pr_info("Fifo Files: ", &Fifos, flag, Sort_wanted);
  347.   #endif
  348.   
  349.   #ifdef S_IFCHR
  350. !     if (Chrs.num > 0 && (Only == 0 || Only == CHAR_ONLY))
  351.           flag = pr_info("Character Special Files: ", &Chrs, flag, Sort_wanted);
  352.   #endif
  353.   
  354.   #ifdef S_IFBLK
  355. !     if (Blks.num > 0 && (Only == 0 || Only == BLOCK_ONLY))
  356.           flag = pr_info("Block Special Files: ", &Blks, flag, Sort_wanted);
  357.   #endif
  358.   
  359. !     if (Dirs.num > 0 && (Only == 0 || Only == DIR_ONLY))
  360.           flag = pr_info("Directories: ", &Dirs, flag, Sort_wanted);
  361.   
  362. !     if (Fls.num > 0 && (Only == 0 || Only == FILE_ONLY))
  363.           flag = pr_info("Files: ", &Fls, flag, Sort_wanted);
  364.   
  365.       return;
  366. --- 590,626 ----
  367.   #endif
  368.   
  369.   #ifdef S_IFSOCK
  370. !     if (Socks.num > 0 && (Only == 0 || Only & SOCK_ONLY))
  371.           flag = pr_info("Sockets: ", &Socks, flag, Sort_wanted);
  372.   #endif
  373.   
  374.   #ifdef S_IFNAM
  375. !     if (Sems.num > 0 && (Only == 0 || Only & SEM_ONLY))
  376.           flag = pr_info("Semaphore Files: ", &Sems, flag, Sort_wanted);
  377.   
  378. !     if (Sds.num > 0 && (Only == 0 || Only & SD_ONLY))
  379.           flag = pr_info("Shared Data Files: ", &Sds, flag, Sort_wanted);
  380.   #endif
  381.   
  382.   #ifdef S_IFIFO
  383. !     if (Fifos.num > 0 && (Only == 0 || Only & FIFO_ONLY))
  384.           flag = pr_info("Fifo Files: ", &Fifos, flag, Sort_wanted);
  385.   #endif
  386.   
  387.   #ifdef S_IFCHR
  388. !     if (Chrs.num > 0 && (Only == 0 || Only & CHAR_ONLY))
  389.           flag = pr_info("Character Special Files: ", &Chrs, flag, Sort_wanted);
  390.   #endif
  391.   
  392.   #ifdef S_IFBLK
  393. !     if (Blks.num > 0 && (Only == 0 || Only & BLOCK_ONLY))
  394.           flag = pr_info("Block Special Files: ", &Blks, flag, Sort_wanted);
  395.   #endif
  396.   
  397. !     if (Dirs.num > 0 && (Only == 0 || Only & DIR_ONLY))
  398.           flag = pr_info("Directories: ", &Dirs, flag, Sort_wanted);
  399.   
  400. !     if (Fls.num > 0 && (Only == 0 || Only & FILE_ONLY))
  401.           flag = pr_info("Files: ", &Fls, flag, Sort_wanted);
  402.   
  403.       return;
  404. ***************
  405. *** 976,990 ****
  406.           break;
  407.   
  408.       case 'b':
  409. !         Only = BLOCK_ONLY;
  410.           break;
  411.   
  412.       case 'c':
  413. !         Only = CHAR_ONLY;
  414.           break;
  415.   
  416.       case 'd':
  417. !         Only = DIR_ONLY;
  418.           break;
  419.   
  420.       case 'D':
  421. --- 980,994 ----
  422.           break;
  423.   
  424.       case 'b':
  425. !         Only |= BLOCK_ONLY;
  426.           break;
  427.   
  428.       case 'c':
  429. !         Only |= CHAR_ONLY;
  430.           break;
  431.   
  432.       case 'd':
  433. !         Only |= DIR_ONLY;
  434.           break;
  435.   
  436.       case 'D':
  437. ***************
  438. *** 996,1002 ****
  439.           break;
  440.   
  441.       case 'f':
  442. !         Only = FILE_ONLY;
  443.           break;
  444.   
  445.       case 'r':
  446. --- 1000,1006 ----
  447.           break;
  448.   
  449.       case 'f':
  450. !         Only |= FILE_ONLY;
  451.           break;
  452.   
  453.       case 'r':
  454. ***************
  455. *** 1005,1011 ****
  456.   
  457.   #ifdef S_IFIFO
  458.       case 'F':
  459. !         Only = FIFO_ONLY;
  460.           break;
  461.   #endif
  462.   
  463. --- 1009,1015 ----
  464.   
  465.   #ifdef S_IFIFO
  466.       case 'F':
  467. !         Only |= FIFO_ONLY;
  468.           break;
  469.   #endif
  470.   
  471. ***************
  472. *** 1015,1021 ****
  473.   
  474.   #ifdef S_IFLNK
  475.       case 's':
  476. !         Only = LNK_ONLY;
  477.           break;
  478.   
  479.       case 'l':
  480. --- 1019,1025 ----
  481.   
  482.   #ifdef S_IFLNK
  483.       case 's':
  484. !         Only |= LNK_ONLY;
  485.           break;
  486.   
  487.       case 'l':
  488. ***************
  489. *** 1033,1049 ****
  490.   
  491.   #ifdef S_IFSOCK
  492.       case 'S':
  493. !         Only = SOCK_ONLY;
  494.           break;
  495.   #endif
  496.   
  497.   #ifdef S_IFNAM
  498.       case 'm':
  499. !         Only = SD_ONLY;
  500.           break;
  501.   
  502.       case 'M':
  503. !         Only = SEM_ONLY;
  504.           break;
  505.   #endif
  506.   
  507. --- 1037,1053 ----
  508.   
  509.   #ifdef S_IFSOCK
  510.       case 'S':
  511. !         Only |= SOCK_ONLY;
  512.           break;
  513.   #endif
  514.   
  515.   #ifdef S_IFNAM
  516.       case 'm':
  517. !         Only |= SD_ONLY;
  518.           break;
  519.   
  520.       case 'M':
  521. !         Only |= SEM_ONLY;
  522.           break;
  523.   #endif
  524.   
  525.