home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume19 / xgetftp / patch02 < prev    next >
Encoding:
Text File  |  1993-04-27  |  34.8 KB  |  897 lines

  1. Newsgroups: comp.sources.x
  2. From: salim@tigger.cs.colorado.edu (Salim Alam)
  3. Subject: v19i078:  xgetftp - Friendly anonymous ftp tool, Patch02
  4. Message-ID: <1993Apr6.145619.18484@sparky.imd.sterling.com>
  5. X-Md4-Signature: 6ff58e78874b5daf57d228ce36ce0ef7
  6. Date: Tue, 6 Apr 1993 14:56:19 GMT
  7. Approved: chris@sparky.imd.sterling.com
  8.  
  9. Submitted-by: salim@tigger.cs.colorado.edu (Salim Alam)
  10. Posting-number: Volume 19, Issue 78
  11. Archive-name: xgetftp/patch02
  12. Environment: X11, OSF/Motif
  13. Patch-To: xgetftp: Volume 19, Issue 22-25,43
  14.  
  15. This is a patch that updates xgetftp-v1.1 to v1.2.  It should _NOT_ be applied
  16. to the original version v1.0.
  17.  
  18. This patch fixes a few more minor bugs, and makes it easier to compile on
  19. certain machines.  Also, config.h allows better customization for different
  20. archie clients.  The README file and man pages have been slightly expanded,
  21. and the GNU License file has been included.
  22.  
  23. The patch can be applied by redirecting the file PATCH1.1-1.2 to the patch
  24. program.
  25.  
  26. -Salim
  27.  
  28. -------------------------- cut here ----------------------------------------
  29. #! /bin/sh
  30. # This is a shell archive, meaning:
  31. # 1. Remove everything above the #! /bin/sh line.
  32. # 2. Save the resulting text in a file.
  33. # 3. Execute the file with /bin/sh (not csh) to create the files:
  34. #    PATCH1.1-1.2
  35. # This archive created: Fri Apr  2 10:43:37 1993
  36. export PATH; PATH=/bin:$PATH
  37. if test -f 'PATCH1.1-1.2'
  38. then
  39.     echo shar: will not over-write existing file "'PATCH1.1-1.2'"
  40. else
  41. cat << \SHAR_EOF > 'PATCH1.1-1.2'
  42. Index: patchlevel.h
  43. *** xgetftp-v1.1/patchlevel.h    Fri Mar 12 15:47:15 1993
  44. --- xgetftp-v1.2/patchlevel.h    Fri Apr  2 10:19:59 1993
  45. ***************
  46. *** 1,2 ****
  47.   #define VERSION        1
  48. ! #define PATCHLEVEL    1
  49. --- 1,2 ----
  50.   #define VERSION        1
  51. ! #define PATCHLEVEL    2
  52. Index: COPYING
  53. *** /dev/null    Fri Apr  2 10:35:02 1993
  54. --- COPYING    Fri Apr  2 10:19:57 1993
  55. ***************
  56. *** 0 ****
  57. --- 1,339 ----
  58. +             GNU GENERAL PUBLIC LICENSE
  59. +                Version 2, June 1991
  60. +  Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  61. +                           675 Mass Ave, Cambridge, MA 02139, USA
  62. +  Everyone is permitted to copy and distribute verbatim copies
  63. +  of this license document, but changing it is not allowed.
  64. +                 Preamble
  65. +   The licenses for most software are designed to take away your
  66. + freedom to share and change it.  By contrast, the GNU General Public
  67. + License is intended to guarantee your freedom to share and change free
  68. + software--to make sure the software is free for all its users.  This
  69. + General Public License applies to most of the Free Software
  70. + Foundation's software and to any other program whose authors commit to
  71. + using it.  (Some other Free Software Foundation software is covered by
  72. + the GNU Library General Public License instead.)  You can apply it to
  73. + your programs, too.
  74. +   When we speak of free software, we are referring to freedom, not
  75. + price.  Our General Public Licenses are designed to make sure that you
  76. + have the freedom to distribute copies of free software (and charge for
  77. + this service if you wish), that you receive source code or can get it
  78. + if you want it, that you can change the software or use pieces of it
  79. + in new free programs; and that you know you can do these things.
  80. +   To protect your rights, we need to make restrictions that forbid
  81. + anyone to deny you these rights or to ask you to surrender the rights.
  82. + These restrictions translate to certain responsibilities for you if you
  83. + distribute copies of the software, or if you modify it.
  84. +   For example, if you distribute copies of such a program, whether
  85. + gratis or for a fee, you must give the recipients all the rights that
  86. + you have.  You must make sure that they, too, receive or can get the
  87. + source code.  And you must show them these terms so they know their
  88. + rights.
  89. +   We protect your rights with two steps: (1) copyright the software, and
  90. + (2) offer you this license which gives you legal permission to copy,
  91. + distribute and/or modify the software.
  92. +   Also, for each author's protection and ours, we want to make certain
  93. + that everyone understands that there is no warranty for this free
  94. + software.  If the software is modified by someone else and passed on, we
  95. + want its recipients to know that what they have is not the original, so
  96. + that any problems introduced by others will not reflect on the original
  97. + authors' reputations.
  98. +   Finally, any free program is threatened constantly by software
  99. + patents.  We wish to avoid the danger that redistributors of a free
  100. + program will individually obtain patent licenses, in effect making the
  101. + program proprietary.  To prevent this, we have made it clear that any
  102. + patent must be licensed for everyone's free use or not licensed at all.
  103. +   The precise terms and conditions for copying, distribution and
  104. + modification follow.
  105. +             GNU GENERAL PUBLIC LICENSE
  106. +    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  107. +   0. This License applies to any program or other work which contains
  108. + a notice placed by the copyright holder saying it may be distributed
  109. + under the terms of this General Public License.  The "Program", below,
  110. + refers to any such program or work, and a "work based on the Program"
  111. + means either the Program or any derivative work under copyright law:
  112. + that is to say, a work containing the Program or a portion of it,
  113. + either verbatim or with modifications and/or translated into another
  114. + language.  (Hereinafter, translation is included without limitation in
  115. + the term "modification".)  Each licensee is addressed as "you".
  116. + Activities other than copying, distribution and modification are not
  117. + covered by this License; they are outside its scope.  The act of
  118. + running the Program is not restricted, and the output from the Program
  119. + is covered only if its contents constitute a work based on the
  120. + Program (independent of having been made by running the Program).
  121. + Whether that is true depends on what the Program does.
  122. +   1. You may copy and distribute verbatim copies of the Program's
  123. + source code as you receive it, in any medium, provided that you
  124. + conspicuously and appropriately publish on each copy an appropriate
  125. + copyright notice and disclaimer of warranty; keep intact all the
  126. + notices that refer to this License and to the absence of any warranty;
  127. + and give any other recipients of the Program a copy of this License
  128. + along with the Program.
  129. + You may charge a fee for the physical act of transferring a copy, and
  130. + you may at your option offer warranty protection in exchange for a fee.
  131. +   2. You may modify your copy or copies of the Program or any portion
  132. + of it, thus forming a work based on the Program, and copy and
  133. + distribute such modifications or work under the terms of Section 1
  134. + above, provided that you also meet all of these conditions:
  135. +     a) You must cause the modified files to carry prominent notices
  136. +     stating that you changed the files and the date of any change.
  137. +     b) You must cause any work that you distribute or publish, that in
  138. +     whole or in part contains or is derived from the Program or any
  139. +     part thereof, to be licensed as a whole at no charge to all third
  140. +     parties under the terms of this License.
  141. +     c) If the modified program normally reads commands interactively
  142. +     when run, you must cause it, when started running for such
  143. +     interactive use in the most ordinary way, to print or display an
  144. +     announcement including an appropriate copyright notice and a
  145. +     notice that there is no warranty (or else, saying that you provide
  146. +     a warranty) and that users may redistribute the program under
  147. +     these conditions, and telling the user how to view a copy of this
  148. +     License.  (Exception: if the Program itself is interactive but
  149. +     does not normally print such an announcement, your work based on
  150. +     the Program is not required to print an announcement.)
  151. + These requirements apply to the modified work as a whole.  If
  152. + identifiable sections of that work are not derived from the Program,
  153. + and can be reasonably considered independent and separate works in
  154. + themselves, then this License, and its terms, do not apply to those
  155. + sections when you distribute them as separate works.  But when you
  156. + distribute the same sections as part of a whole which is a work based
  157. + on the Program, the distribution of the whole must be on the terms of
  158. + this License, whose permissions for other licensees extend to the
  159. + entire whole, and thus to each and every part regardless of who wrote it.
  160. + Thus, it is not the intent of this section to claim rights or contest
  161. + your rights to work written entirely by you; rather, the intent is to
  162. + exercise the right to control the distribution of derivative or
  163. + collective works based on the Program.
  164. + In addition, mere aggregation of another work not based on the Program
  165. + with the Program (or with a work based on the Program) on a volume of
  166. + a storage or distribution medium does not bring the other work under
  167. + the scope of this License.
  168. +   3. You may copy and distribute the Program (or a work based on it,
  169. + under Section 2) in object code or executable form under the terms of
  170. + Sections 1 and 2 above provided that you also do one of the following:
  171. +     a) Accompany it with the complete corresponding machine-readable
  172. +     source code, which must be distributed under the terms of Sections
  173. +     1 and 2 above on a medium customarily used for software interchange; or,
  174. +     b) Accompany it with a written offer, valid for at least three
  175. +     years, to give any third party, for a charge no more than your
  176. +     cost of physically performing source distribution, a complete
  177. +     machine-readable copy of the corresponding source code, to be
  178. +     distributed under the terms of Sections 1 and 2 above on a medium
  179. +     customarily used for software interchange; or,
  180. +     c) Accompany it with the information you received as to the offer
  181. +     to distribute corresponding source code.  (This alternative is
  182. +     allowed only for noncommercial distribution and only if you
  183. +     received the program in object code or executable form with such
  184. +     an offer, in accord with Subsection b above.)
  185. + The source code for a work means the preferred form of the work for
  186. + making modifications to it.  For an executable work, complete source
  187. + code means all the source code for all modules it contains, plus any
  188. + associated interface definition files, plus the scripts used to
  189. + control compilation and installation of the executable.  However, as a
  190. + special exception, the source code distributed need not include
  191. + anything that is normally distributed (in either source or binary
  192. + form) with the major components (compiler, kernel, and so on) of the
  193. + operating system on which the executable runs, unless that component
  194. + itself accompanies the executable.
  195. + If distribution of executable or object code is made by offering
  196. + access to copy from a designated place, then offering equivalent
  197. + access to copy the source code from the same place counts as
  198. + distribution of the source code, even though third parties are not
  199. + compelled to copy the source along with the object code.
  200. +   4. You may not copy, modify, sublicense, or distribute the Program
  201. + except as expressly provided under this License.  Any attempt
  202. + otherwise to copy, modify, sublicense or distribute the Program is
  203. + void, and will automatically terminate your rights under this License.
  204. + However, parties who have received copies, or rights, from you under
  205. + this License will not have their licenses terminated so long as such
  206. + parties remain in full compliance.
  207. +   5. You are not required to accept this License, since you have not
  208. + signed it.  However, nothing else grants you permission to modify or
  209. + distribute the Program or its derivative works.  These actions are
  210. + prohibited by law if you do not accept this License.  Therefore, by
  211. + modifying or distributing the Program (or any work based on the
  212. + Program), you indicate your acceptance of this License to do so, and
  213. + all its terms and conditions for copying, distributing or modifying
  214. + the Program or works based on it.
  215. +   6. Each time you redistribute the Program (or any work based on the
  216. + Program), the recipient automatically receives a license from the
  217. + original licensor to copy, distribute or modify the Program subject to
  218. + these terms and conditions.  You may not impose any further
  219. + restrictions on the recipients' exercise of the rights granted herein.
  220. + You are not responsible for enforcing compliance by third parties to
  221. + this License.
  222. +   7. If, as a consequence of a court judgment or allegation of patent
  223. + infringement or for any other reason (not limited to patent issues),
  224. + conditions are imposed on you (whether by court order, agreement or
  225. + otherwise) that contradict the conditions of this License, they do not
  226. + excuse you from the conditions of this License.  If you cannot
  227. + distribute so as to satisfy simultaneously your obligations under this
  228. + License and any other pertinent obligations, then as a consequence you
  229. + may not distribute the Program at all.  For example, if a patent
  230. + license would not permit royalty-free redistribution of the Program by
  231. + all those who receive copies directly or indirectly through you, then
  232. + the only way you could satisfy both it and this License would be to
  233. + refrain entirely from distribution of the Program.
  234. + If any portion of this section is held invalid or unenforceable under
  235. + any particular circumstance, the balance of the section is intended to
  236. + apply and the section as a whole is intended to apply in other
  237. + circumstances.
  238. + It is not the purpose of this section to induce you to infringe any
  239. + patents or other property right claims or to contest validity of any
  240. + such claims; this section has the sole purpose of protecting the
  241. + integrity of the free software distribution system, which is
  242. + implemented by public license practices.  Many people have made
  243. + generous contributions to the wide range of software distributed
  244. + through that system in reliance on consistent application of that
  245. + system; it is up to the author/donor to decide if he or she is willing
  246. + to distribute software through any other system and a licensee cannot
  247. + impose that choice.
  248. + This section is intended to make thoroughly clear what is believed to
  249. + be a consequence of the rest of this License.
  250. +   8. If the distribution and/or use of the Program is restricted in
  251. + certain countries either by patents or by copyrighted interfaces, the
  252. + original copyright holder who places the Program under this License
  253. + may add an explicit geographical distribution limitation excluding
  254. + those countries, so that distribution is permitted only in or among
  255. + countries not thus excluded.  In such case, this License incorporates
  256. + the limitation as if written in the body of this License.
  257. +   9. The Free Software Foundation may publish revised and/or new versions
  258. + of the General Public License from time to time.  Such new versions will
  259. + be similar in spirit to the present version, but may differ in detail to
  260. + address new problems or concerns.
  261. + Each version is given a distinguishing version number.  If the Program
  262. + specifies a version number of this License which applies to it and "any
  263. + later version", you have the option of following the terms and conditions
  264. + either of that version or of any later version published by the Free
  265. + Software Foundation.  If the Program does not specify a version number of
  266. + this License, you may choose any version ever published by the Free Software
  267. + Foundation.
  268. +   10. If you wish to incorporate parts of the Program into other free
  269. + programs whose distribution conditions are different, write to the author
  270. + to ask for permission.  For software which is copyrighted by the Free
  271. + Software Foundation, write to the Free Software Foundation; we sometimes
  272. + make exceptions for this.  Our decision will be guided by the two goals
  273. + of preserving the free status of all derivatives of our free software and
  274. + of promoting the sharing and reuse of software generally.
  275. +                 NO WARRANTY
  276. +   11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  277. + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
  278. + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  279. + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  280. + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  281. + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
  282. + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  283. + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  284. + REPAIR OR CORRECTION.
  285. +   12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  286. + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  287. + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  288. + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  289. + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
  290. + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  291. + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  292. + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  293. + POSSIBILITY OF SUCH DAMAGES.
  294. +              END OF TERMS AND CONDITIONS
  295. +     Appendix: How to Apply These Terms to Your New Programs
  296. +   If you develop a new program, and you want it to be of the greatest
  297. + possible use to the public, the best way to achieve this is to make it
  298. + free software which everyone can redistribute and change under these terms.
  299. +   To do so, attach the following notices to the program.  It is safest
  300. + to attach them to the start of each source file to most effectively
  301. + convey the exclusion of warranty; and each file should have at least
  302. + the "copyright" line and a pointer to where the full notice is found.
  303. +     <one line to give the program's name and a brief idea of what it does.>
  304. +     Copyright (C) 19yy  <name of author>
  305. +     This program is free software; you can redistribute it and/or modify
  306. +     it under the terms of the GNU General Public License as published by
  307. +     the Free Software Foundation; either version 2 of the License, or
  308. +     (at your option) any later version.
  309. +     This program is distributed in the hope that it will be useful,
  310. +     but WITHOUT ANY WARRANTY; without even the implied warranty of
  311. +     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  312. +     GNU General Public License for more details.
  313. +     You should have received a copy of the GNU General Public License
  314. +     along with this program; if not, write to the Free Software
  315. +     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  316. + Also add information on how to contact you by electronic and paper mail.
  317. + If the program is interactive, make it output a short notice like this
  318. + when it starts in an interactive mode:
  319. +     Gnomovision version 69, Copyright (C) 19yy name of author
  320. +     Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  321. +     This is free software, and you are welcome to redistribute it
  322. +     under certain conditions; type `show c' for details.
  323. + The hypothetical commands `show w' and `show c' should show the appropriate
  324. + parts of the General Public License.  Of course, the commands you use may
  325. + be called something other than `show w' and `show c'; they could even be
  326. + mouse-clicks or menu items--whatever suits your program.
  327. + You should also get your employer (if you work as a programmer) or your
  328. + school, if any, to sign a "copyright disclaimer" for the program, if
  329. + necessary.  Here is a sample; alter the names:
  330. +   Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  331. +   `Gnomovision' (which makes passes at compilers) written by James Hacker.
  332. +   <signature of Ty Coon>, 1 April 1989
  333. +   Ty Coon, President of Vice
  334. + This General Public License does not permit incorporating your program into
  335. + proprietary programs.  If your program is a subroutine library, you may
  336. + consider it more useful to permit linking proprietary applications with the
  337. + library.  If this is what you want to do, use the GNU Library General
  338. + Public License instead of this License.
  339. Index: Imakefile
  340. *** xgetftp-v1.1/Imakefile    Fri Mar 12 15:47:13 1993
  341. --- xgetftp-v1.2/Imakefile    Fri Apr  2 10:19:57 1993
  342. ***************
  343. *** 1,5 ****
  344.                    CC = gcc 
  345. ! #       CDEBUGFLAGS = -g -DDEBUG
  346.       EXTRA_LIBRARIES = -lXm -lXt -lX11
  347.                  SRCS = cache.c control.c file_cache.c ftp.c \
  348.                           main.c prefs.c ui_funcs.c 
  349. --- 1,5 ----
  350.                    CC = gcc 
  351. !        CDEBUGFLAGS = -g -DDEBUG
  352.       EXTRA_LIBRARIES = -lXm -lXt -lX11
  353.                  SRCS = cache.c control.c file_cache.c ftp.c \
  354.                           main.c prefs.c ui_funcs.c 
  355. Index: Manifest
  356. *** xgetftp-v1.1/Manifest    Fri Mar 12 15:47:13 1993
  357. --- xgetftp-v1.2/Manifest    Fri Apr  2 10:21:20 1993
  358. ***************
  359. *** 1,3 ****
  360. --- 1,4 ----
  361. + COPYING        GNU Software Licence
  362.   Imakefile    Used to produce makefile
  363.   Makefile    If you cant use the makefile, try to edit & use this
  364.   README        Instructions on compiling, installing
  365. Index: README
  366. *** xgetftp-v1.1/README    Fri Mar 12 15:47:13 1993
  367. --- xgetftp-v1.2/README    Fri Apr  2 10:40:22 1993
  368. ***************
  369. *** 1,5 ****
  370.   ==========================================================================
  371. ! xgetftp v1.1
  372.   ==========================================================================
  373.   
  374.   I. Authors:
  375. --- 1,5 ----
  376.   ==========================================================================
  377. ! xgetftp v1.2
  378.   ==========================================================================
  379.   
  380.   I. Authors:
  381. ***************
  382. *** 15,20 ****
  383. --- 15,34 ----
  384.      This program is copyright Salim Alam, 1993.  It is freely distributable
  385.      under the GNU Software License.
  386.   
  387. +    This program is free software; you can redistribute it and/or modify
  388. +    it under the terms of the GNU General Public License as published by
  389. +    the Free Software Foundation.
  390. +    This program is distributed in the hope that it will be useful,
  391. +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  392. +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  393. +    GNU General Public License for more details.
  394. +    You should have received a copy of the GNU General Public License
  395. +    along with this program (see file "COPYING"); if not, write to the
  396. +    Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
  397. +    USA.
  398.   ==========================================================================
  399.   
  400.   III. Building and Installing xgetftp:
  401. ***************
  402. *** 40,45 ****
  403. --- 54,65 ----
  404.   ".xgetftprc" file was not found.  To create this file, simply select
  405.   "Set Preferences" from the File menu and click on "Save".
  406.   
  407. + When first starting xgetftp, if your window doesn't come up correctly sized,
  408. + add the following line to your .Xresources file:
  409. +    Xgetftp*geometry:    800x600
  410. + (This problem seems to occur on SGI machines.)
  411.   ==========================================================================
  412.   
  413.   V. Acknowledgments:
  414. ***************
  415. *** 50,54 ****
  416. --- 70,77 ----
  417.   Robert G Henderson    <robh@eclipse.cs.colorado.edu>
  418.   Christopher Joslyn    <joslyn@spot.Colorado.EDU>
  419.   Rich Neves        <neves@cs.colorado.edu>
  420. + I would also like to thank all the people on the net who sent suggestions
  421. + and initial bug reports.  There are too many to list by name.
  422.   
  423.   ==========================================================================
  424. Index: cache.c
  425. *** xgetftp-v1.1/cache.c    Fri Mar 12 15:47:13 1993
  426. --- xgetftp-v1.2/cache.c    Fri Apr  2 10:19:57 1993
  427. ***************
  428. *** 10,15 ****
  429. --- 10,16 ----
  430.    *  University of Colorado, Boulder
  431.    *
  432.    * MODIFICATION LOG:
  433. +  *  93.03.16 S.A. Made cache_set_root more robust.
  434.    *  93.01.27 S.A. Now closing cache saved/loaded files correctly
  435.    *  92.12.15 S.A. Fixed bug, made cache_load_levels more robust
  436.    *  92.12.09 S.A. Added dir caching functions.
  437. ***************
  438. *** 67,75 ****
  439.        * save complete pathname of the root, without the "/" postfix
  440.        */
  441.       curr_path_index = 0;
  442. !     if (root[len-1] == '/') len--;    
  443.       curr_path[0] = (char *) malloc(len + 1);
  444. !     strncpy(curr_path[0], root, len);
  445.       curr_path[0][len] = '\0';
  446.   #ifdef DEBUG
  447.       printf("cache_set_root: Saving root as: '%s'\n", curr_path[0]);
  448. --- 68,76 ----
  449.        * save complete pathname of the root, without the "/" postfix
  450.        */
  451.       curr_path_index = 0;
  452. !     if (*root && (root[len-1] == '/')) len--;    
  453.       curr_path[0] = (char *) malloc(len + 1);
  454. !     if (len) strncpy(curr_path[0], root, len);
  455.       curr_path[0][len] = '\0';
  456.   #ifdef DEBUG
  457.       printf("cache_set_root: Saving root as: '%s'\n", curr_path[0]);
  458. Index: config.h
  459. *** xgetftp-v1.1/config.h    Fri Mar 12 15:47:14 1993
  460. --- xgetftp-v1.2/config.h    Fri Apr  2 10:19:57 1993
  461. ***************
  462. *** 12,19 ****
  463.   #define ARCHIEBIN       "/usr/local/bin/archie"
  464.   
  465.   /*
  466. !  * ARCHIESERVER defines the server to use.  The archie client
  467. !  * defined above should allow a "-server" option.
  468.    *
  469.    */
  470.   #define ARCHIESERVER    "archie.sura.net"
  471. --- 12,28 ----
  472.   #define ARCHIEBIN       "/usr/local/bin/archie"
  473.   
  474.   /*
  475. !  * ARCHIESRVRARG defines the argument needed to invoke a specific
  476. !  * server.  If you have a client based on Prospero, you should 
  477. !  * use the "-h" option.
  478. !  *
  479. !  */
  480. ! /* #define ARCHIESRVRARG    "-h" */
  481. ! #define ARCHIESRVRARG    "-server"
  482. ! /*
  483. !  * ARCHIESERVER defines the server to use.  Change this to be your
  484. !  * favorite server.
  485.    *
  486.    */
  487.   #define ARCHIESERVER    "archie.sura.net"
  488. Index: file_cache.c
  489. *** xgetftp-v1.1/file_cache.c    Fri Mar 12 15:47:14 1993
  490. --- xgetftp-v1.2/file_cache.c    Fri Apr  2 10:19:58 1993
  491. ***************
  492. *** 12,17 ****
  493. --- 12,19 ----
  494.    *  University of Colorado, Boulder
  495.    *
  496.    * MODIFICATION LOG:
  497. +  *  93.03.16 S.A. - Fixed bug in fc_mkdir_path, added auto cache dir
  498. +  *            creating in fc_set_root_dir.
  499.    *  92.12.29 S.A. - Added file cache delete function
  500.    *
  501.    **************************************************************************/
  502. ***************
  503. *** 86,91 ****
  504. --- 88,110 ----
  505.           sprintf(cache_root, "%s/%s/%s", tmp_str, DEFAULT_CACHE_DIR, hostname);
  506.       }
  507.   
  508. +     /*
  509. +      * If directory doesn't exist, create it.
  510. +      */
  511. +     tmp_str = malloc(strlen(cache_root) + 2);     /* we need to muck around
  512. +                            a little bit here... */
  513. +     sprintf(tmp_str,"%s/", cache_root);
  514. +     if (!fc_mkdir_path(tmp_str))
  515. +     {
  516. +     fprintf(stderr, "fc_set_root_dir: can't make root path '%s'\n",
  517. +         cache_root);
  518. +     }
  519. +     free(tmp_str);
  520.   #ifdef DEBUG
  521.           fprintf(stderr, "Cache root = '%s'\n", cache_root);
  522.   #endif
  523. ***************
  524. *** 124,129 ****
  525. --- 143,152 ----
  526.    * sure that all the directories in the path are present.  This function
  527.    * will call "mkdir" to create any needed directories.
  528.    *
  529. +  * Note that the "path" can contain a file at the end.  If the last 
  530. +  * component of the path does not end with a "/" it is assumed to be a
  531. +  * file and is _not_ checked!
  532. +  *
  533.    * Returns TRUE for success, FALSE otherwise.
  534.    *
  535.    */
  536. ***************
  537. *** 132,144 ****
  538.       struct stat stat_buf;
  539.   
  540.       /*
  541. !      * First, check the complete path at once
  542.        */
  543.       if (stat(path, &stat_buf) == 0)    
  544.       {
  545.       if (!S_ISDIR(stat_buf.st_mode))
  546.       {
  547. !         fprintf(stderr, "ctrl_get_directory: '%s' is not a dir.\n",
  548.           path);
  549.           return FALSE;
  550.       }
  551. --- 155,168 ----
  552.       struct stat stat_buf;
  553.   
  554.       /*
  555. !      * First, check the complete path at once.  If the complete path
  556. !      * exists, check to see if it is a directory.
  557.        */
  558.       if (stat(path, &stat_buf) == 0)    
  559.       {
  560.       if (!S_ISDIR(stat_buf.st_mode))
  561.       {
  562. !         fprintf(stderr, "fc_mkdir_path: '%s' is not a dir.\n",
  563.           path);
  564.           return FALSE;
  565.       }
  566. ***************
  567. *** 147,160 ****
  568.   
  569.   
  570.       /*
  571. !      * Now check component-wise
  572.        */
  573.       s = path;
  574.       while (*s)
  575.       {
  576. !     while ((*s) && (*s != '/')) s++;
  577.       if (*s == '/')
  578. !     /* check component */
  579.       {
  580.           *s = '\0';
  581.   #ifdef DEBUG
  582. --- 171,189 ----
  583.   
  584.   
  585.       /*
  586. !      * Otherwise check component-wise, directory by directory
  587.        */
  588.       s = path;
  589. +     if ((*s) && (*s == '/')) s++;     /* skip the first component, since
  590. +                        stat on some systems can't handle
  591. +                        empty paths */
  592.       while (*s)
  593.       {
  594. !     while ((*s) && (*s != '/')) s++; /* skip to the next component */
  595.       if (*s == '/')
  596. !     /* check directory component */
  597.       {
  598.           *s = '\0';
  599.   #ifdef DEBUG
  600. ***************
  601. *** 185,191 ****
  602.           }
  603.           *s = '/';
  604.           s++;
  605. !     } /* while */
  606.   
  607.       } /* while */
  608.   }
  609. --- 214,220 ----
  610.           }
  611.           *s = '/';
  612.           s++;
  613. !     } /* if */
  614.   
  615.       } /* while */
  616.   }
  617. Index: ftp.c
  618. *** xgetftp-v1.1/ftp.c    Fri Mar 12 15:47:14 1993
  619. --- xgetftp-v1.2/ftp.c    Fri Apr  2 10:19:58 1993
  620. ***************
  621. *** 10,15 ****
  622. --- 10,16 ----
  623.    *  University of Colorado, Boulder
  624.    *
  625.    * MODIFICATION LOG:
  626. +  *  93.03.16 S.A. - yet another bug fix (DEBUG mode)
  627.    *  93.03.10 S.A. - better support for variable arguments
  628.    *  93.01.14 S.A. - fixed return bug in ftp_init_conn
  629.    *  92.12.29 S.A. - ftp_init_conn now handles some errors more gracefully.
  630. ***************
  631. *** 186,192 ****
  632. --- 187,198 ----
  633.   
  634.   #ifdef DEBUG
  635.       fprintf(stderr,"Sending: ");
  636. + #ifdef USE_PROTOTYPES
  637.       va_start(ap, fmt);
  638. + #else
  639. +     va_start(ap);
  640. +     fmt = (char *)va_arg(ap, char *);
  641. + #endif
  642.       vfprintf(stderr, fmt, ap);
  643.       va_end(ap);
  644.       fprintf(stderr, "\n");
  645. Index: main.c
  646. *** xgetftp-v1.1/main.c    Fri Mar 12 15:47:14 1993
  647. --- xgetftp-v1.2/main.c    Fri Apr  2 10:22:59 1993
  648. ***************
  649. *** 10,15 ****
  650. --- 10,17 ----
  651.    *  University of Colorado, Boulder
  652.    *
  653.    * MODIFICATION LOG:
  654. +  *  93.04.01 S.A. - Allow Prospero-based archie server
  655. +  *  93.03.17 S.A. - Bug fix in get_view_data and get_archie_data
  656.    *  93.02.15 S.A. - Mods for new ctrl_delete_cache
  657.    *  93.02.03 S.A. - Better error-handling: ctrl_start_session,ctrl_down_dir
  658.    *  93.01.26 S.A. - Now gets local hostname correctly
  659. ***************
  660. *** 193,199 ****
  661.    */
  662.   void get_archie_data(int *ppos, int *fid, XtInputId *id)
  663.   {
  664. !     unsigned char buf[INBUFSIZE];
  665.       int nbytes;
  666.   
  667.       nbytes = read(*fid, buf, INBUFSIZE);
  668. --- 195,201 ----
  669.    */
  670.   void get_archie_data(int *ppos, int *fid, XtInputId *id)
  671.   {
  672. !     unsigned char buf[INBUFSIZE+1];
  673.       int nbytes;
  674.   
  675.       nbytes = read(*fid, buf, INBUFSIZE);
  676. ***************
  677. *** 245,256 ****
  678.      ui_set_cursor_busy(archiebbW);
  679.   
  680.      find_str = (char *) XmTextGetString(archiefindtextW);
  681.      fprintf(stderr, "Archie find: '%s'\n", find_str);
  682.   
  683.      sprintf(filename, "/tmp/xgetftpARCHIE%ld", getpid());
  684.   
  685. !    sprintf(dummy, "%s -server %s %s > %s", ARCHIEBIN, ARCHIESERVER, find_str,
  686. !     filename);
  687.      system(dummy);
  688.      XtFree(find_str);
  689.   
  690. --- 247,260 ----
  691.      ui_set_cursor_busy(archiebbW);
  692.   
  693.      find_str = (char *) XmTextGetString(archiefindtextW);
  694. + #ifdef DEBUG
  695.      fprintf(stderr, "Archie find: '%s'\n", find_str);
  696. + #endif
  697.   
  698.      sprintf(filename, "/tmp/xgetftpARCHIE%ld", getpid());
  699.   
  700. !    sprintf(dummy, "%s %s %s %s > %s", ARCHIEBIN, ARCHIESRVRARG, ARCHIESERVER,
  701. !     find_str, filename);
  702.      system(dummy);
  703.      XtFree(find_str);
  704.   
  705. ***************
  706. *** 492,498 ****
  707.    */
  708.   void get_view_data(int *ppos, int *fid, XtInputId *id)
  709.   {
  710. !     unsigned char buf[INBUFSIZE];
  711.       int nbytes, len;
  712.   
  713.       nbytes = read(*fid, buf, INBUFSIZE);
  714. --- 496,502 ----
  715.    */
  716.   void get_view_data(int *ppos, int *fid, XtInputId *id)
  717.   {
  718. !     unsigned char buf[INBUFSIZE+1];
  719.       int nbytes, len;
  720.   
  721.       nbytes = read(*fid, buf, INBUFSIZE);
  722. Index: ui_funcs.c
  723. *** xgetftp-v1.1/ui_funcs.c    Fri Mar 12 15:47:15 1993
  724. --- xgetftp-v1.2/ui_funcs.c    Fri Apr  2 10:19:59 1993
  725. ***************
  726. *** 10,15 ****
  727. --- 10,17 ----
  728.    *  University of Colorado, Boulder
  729.    *
  730.    * MODIFICATION LOG:
  731. +  *  93.03.17 S.A. - modified default host, removed "Cancel" from about dlg
  732. +  *            added label to open connection dialog.
  733.    *  93.03.11 S.A. - Fixed mesg initialization problem.
  734.    *
  735.    **************************************************************************/
  736. ***************
  737. *** 225,231 ****
  738.   {
  739.       Arg args[3];
  740.       XmString xmstr[2];
  741. !     char *mesg = "xgetftp v1.1\n\nSalim Alam\nUniversity of Colorado, Boulder\n\nPlease email all bug reports and\ncomments to: salim@cs.colorado.edu";
  742.   
  743.       xmstr[0] = XmStringCreateLtoR(mesg, XmSTRING_DEFAULT_CHARSET);
  744.       XtSetArg(args[0], XmNmessageString, xmstr[0]);
  745. --- 227,233 ----
  746.   {
  747.       Arg args[3];
  748.       XmString xmstr[2];
  749. !     char *mesg = "xgetftp v1.2\n\nSalim Alam\nUniversity of Colorado, Boulder\n\nPlease email all bug reports and\ncomments to: salim@cs.colorado.edu";
  750.   
  751.       xmstr[0] = XmStringCreateLtoR(mesg, XmSTRING_DEFAULT_CHARSET);
  752.       XtSetArg(args[0], XmNmessageString, xmstr[0]);
  753. ***************
  754. *** 237,242 ****
  755. --- 239,245 ----
  756.       XmStringFree(xmstr[1]);
  757.   
  758.       XtUnmanageChild(XmMessageBoxGetChild(aboutdialogW, XmDIALOG_HELP_BUTTON));
  759. +     XtUnmanageChild(XmMessageBoxGetChild(aboutdialogW, XmDIALOG_CANCEL_BUTTON));
  760.   }
  761.   
  762.   
  763. ***************
  764. *** 656,663 ****
  765.       XtSetArg(args[2], XmNtextColumns, 1);
  766.       xmstr[0] = XmStringCreateSimple("Please type in host name:");
  767.       XtSetArg(args[3], XmNselectionLabelString, xmstr[0]);
  768. !     xmstr[1] = XmStringCreateSimple("cs.colorado.edu");
  769. !     XtSetArg(args[4], XmNtextString, xmstr[1]);
  770.       opendlgW = XmCreatePromptDialog(parent, "hprompt", args, 5);
  771.       XmStringFree(xmstr[0]);
  772.       XmStringFree(xmstr[1]);
  773. --- 659,666 ----
  774.       XtSetArg(args[2], XmNtextColumns, 1);
  775.       xmstr[0] = XmStringCreateSimple("Please type in host name:");
  776.       XtSetArg(args[3], XmNselectionLabelString, xmstr[0]);
  777. !     xmstr[1] = XmStringCreateSimple("Open Connection");
  778. !     XtSetArg(args[4], XmNlabelString, xmstr[1]);
  779.       opendlgW = XmCreatePromptDialog(parent, "hprompt", args, 5);
  780.       XmStringFree(xmstr[0]);
  781.       XmStringFree(xmstr[1]);
  782. Index: xgetftp.doc
  783. *** xgetftp-v1.1/xgetftp.doc    Fri Mar 12 15:47:19 1993
  784. --- xgetftp-v1.2/xgetftp.doc    Fri Apr  2 10:20:04 1993
  785. ***************
  786. *** 189,194 ****
  787. --- 189,198 ----
  788.   Hosts cannot be specified using an IP address, the actual hostname
  789.   must be used.
  790.   
  791. + Some ftp servers do not return a standard "ls -l" output when given
  792. + the DIR command.  xgetftp cannot parse a non-standard output and
  793. + will not function properly.
  794.   
  795.   AUTHOR
  796.   Salim Alam
  797. Index: xgetftp.man
  798. *** xgetftp-v1.1/xgetftp.man    Fri Mar 12 15:47:19 1993
  799. --- xgetftp-v1.2/xgetftp.man    Fri Apr  2 10:20:04 1993
  800. ***************
  801. *** 219,224 ****
  802. --- 219,228 ----
  803.   Hosts cannot be specified using an IP address, the actual hostname
  804.   must be used.
  805.   
  806. + Some ftp servers do not return a standard "ls -l" output when given
  807. + the DIR command.  xgetftp cannot parse a non-standard output and
  808. + will not function properly.
  809.   .SH AUTHOR
  810.   Salim Alam
  811.   .br
  812. SHAR_EOF
  813. fi # end of overwriting check
  814. #    End of shell archive
  815. exit 0
  816.  
  817. exit 0 # Just in case...
  818. -- 
  819.   // chris@IMD.Sterling.COM            | Send comp.sources.x submissions to:
  820. \X/  Amiga - The only way to fly!      |
  821.  "It's intuitively obvious to the most |    sources-x@imd.sterling.com
  822.   casual observer..."                  |
  823.