Fixed missing fprintf argument.
[AROS.git] / rom / dos / match_old.c
blobf50e8aa39999b9cb10d0e1c263f8285370778be5
1 matchfirst.c:
5 /*
6 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
7 $Id$
9 Desc:
10 Lang: english
12 #include "dos_intern.h"
13 #include <proto/exec.h>
14 #include <exec/memory.h>
15 #include <exec/types.h>
16 #include <dos/dos.h>
18 /*****************************************************************************
20 NAME */
21 #include <dos/dosasl.h>
22 #include <proto/dos.h>
24 AROS_LH2(LONG, MatchFirst,
26 /* SYNOPSIS */
27 AROS_LHA(STRPTR , pat, D1),
28 AROS_LHA(struct AnchorPath *, AP , D2),
30 /* LOCATION */
31 struct DosLibrary *, DOSBase, 137, Dos)
33 /* FUNCTION
35 Searches for the first file or directory that matches a given pattern.
36 MatchFirst() initializes the AnchorPath structure for you but you
37 must initilize the following fields: ap_Flags, ap_Strlen, ap_BreakBits
38 and ap_FoundBreak. The first call to MatchFirst() also passes you
39 the first matching file which you can examine in ap_Info and the directory
40 the files is in in ap_Current->an_Lock. After the first call to
41 MatchFirst() call MatchNext().
42 The search begins whereever the current directory is set to. See
43 CurrentDir();
44 For more info on patterns see ParsePattern().
46 INPUTS
47 pat - pattern to search for
48 AP - pointer to (initilized) AnchorPath structure
50 RESULT
51 0 = success
52 other = DOS error code
54 NOTES
56 EXAMPLE
58 BUGS
59 Copying of the relative path to ap_Buf is not implemented yet
61 SEE ALSO
62 MatchNext(), MatchEnd(), ParsePattern(), Examine(), CurrentDir()
63 <dos/dosasl.h>
65 INTERNALS
67 *****************************************************************************/
69 AROS_LIBFUNC_INIT
70 AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
72 struct AChain * AC;
73 struct AChain * AC_Prev = NULL;
74 LONG PatLength;
75 STRPTR ParsedPattern;
76 BPTR firstlock;
78 bug("matchfirst\n");
80 if (!pat)
81 return FALSE;
83 AP->ap_Base = NULL;
84 AP->ap_Current = NULL;
86 PatLength = 2*strlen(pat)+2;
87 ParsedPattern = AllocMem(PatLength, MEMF_ANY);
90 if (NULL != ParsedPattern)
92 LONG PatStart = 0;
93 LONG PatEnd = 0;
94 BOOL AllDone = FALSE;
95 LONG index;
96 LONG success = FALSE;
97 BPTR origdir;
99 bug("matchfirst: ParsedPattern mem okay. Calling ParsePatternNoCase\n");
102 ** Put the preparsed string to some memory
103 ** If there are any wildcards then leave info
105 if (1 == ParsePatternNoCase(pat, ParsedPattern, PatLength))
106 AP->ap_Flags |= (BYTE)APF_ITSWILD;
108 //bug("matchfirst: ParsePatternNoCase returned: pattern = \"%s\"\n", ParsedPattern);
111 ** First I search for the very first ':'. If a '/' comes along
112 ** before that I quit. The string before and including the ':'
113 ** is assumed to be an assigned directory, for example 'libs:'.
114 ** So I will start looking for the pattern in that directory.
116 while (TRUE)
118 if (ParsedPattern[PatEnd] == ':')
120 success = TRUE;
121 break;
123 else
125 if ( ParsedPattern[PatEnd] == '/' ||
126 ParsedPattern[PatEnd] == '\0' ||
127 (ParsedPattern[PatEnd] & 0x80) != 0
128 /* a token or nonprintable letter */)
130 PatEnd = 0;
131 break;
134 PatEnd++;
138 ** Only if success == TRUE an assigned dir was found.
140 if (TRUE == success)
143 ** try to create a lock to that assigned dir.
145 char Remember = ParsedPattern[PatEnd+1];
146 PatEnd++;
147 ParsedPattern[PatEnd] = '\0';
148 firstlock = Lock(ParsedPattern, ACCESS_READ);
149 origdir = CurrentDir(firstlock);
152 ** check whether an error occurred
154 if (NULL == firstlock)
156 FreeMem(ParsedPattern, PatLength);
157 return IoErr(); // ERROR_DIR_NOT_FOUND; /* !!! hope that's the right error code... */
161 ** I have the correct lock.
163 ParsedPattern[PatEnd] = Remember;
164 PatStart=PatEnd;
166 } /* if (TRUE == success) */
167 else
170 ** Create a lock to the current dir.
172 origdir = CurrentDir(NULL);
173 firstlock = DupLock(origdir);
174 if (!firstlock)
176 FreeMem(ParsedPattern, PatLength);
177 return IoErr();
180 (void)CurrentDir(firstlock);
183 bug("MatchFirst: origdir = %x\n", origdir);
184 bug("MatchFirst: firstlock = %x\n", firstlock);
187 ** Allocate an AChain structure for the original directory.
189 AC = (struct AChain *)AllocVec(sizeof(struct AChain), MEMF_CLEAR);
190 if (NULL == AC)
193 ** No more memory
195 FreeMem(ParsedPattern, PatLength);
196 UnLock(firstlock);
197 CurrentDir(origdir);
199 return ERROR_NO_FREE_STORE;
202 AC->an_Lock = origdir;
203 AC->an_Flags = DDF_Completed|DDF_Single;
204 AC_Prev = AC;
207 AP->ap_Base = AC;
210 ** Build the Anchor Chain. For every subdirectory I allocate
211 ** an AChain structure and link them all together
213 while (FALSE == AllDone)
216 ** Search for the next '/' in the pattern and everything behind
217 ** the previous '/' and before this '/' will go to an_String
219 while (TRUE)
221 if (ParsedPattern[PatEnd] == '\0')
223 AllDone = TRUE;
224 PatEnd--;
225 break;
227 if (ParsedPattern[PatEnd] == '/')
229 PatEnd--;
230 break;
232 PatEnd++;
234 } /* while(TRUE) */
236 AC = AllocVec(sizeof(struct AChain)+(PatEnd-PatStart+2), MEMF_CLEAR);
237 if (NULL == AC)
239 /* not so bad if this was not the very first AC. */
240 if (NULL == AP->ap_Base)
243 ** oops, it was the very first one. I really cannot do anything for
244 ** you. - sorry
246 FreeMem(ParsedPattern, PatLength);
248 UnLock(AP->ap_Base->an_Lock);
249 CurrentDir(origdir); /* stegerg */
250 FreeMem(AP->ap_Base, sizeof(struct AChain));
252 return ERROR_NO_FREE_STORE;
256 ** let me out of here. I will at least try to do something for you.
257 ** I can check the first few subdirs but that's gonna be it.
259 AP->ap_Flags |= APF_NOMEMERR;
260 break;
262 } /* if (NULL == AC) */
264 if (NULL == AP->ap_Base)
265 AP->ap_Base = AC;
267 if (NULL == AP->ap_Current)
268 AP->ap_Current = AC;
271 if (NULL != AC_Prev)
272 AC_Prev->an_Child = AC;
274 AC->an_Parent = AC_Prev;
275 AC_Prev = AC;
278 ** copy the part of the pattern to the end of the AChain.
280 index = 0;
281 while (PatStart <= PatEnd)
283 AC->an_String[index] = ParsedPattern[PatStart];
284 index++;
285 PatStart++;
289 ** Put PatStart and PetEnd behind the '/' that was found.
291 PatStart = PatEnd + 2;
292 PatEnd += 2;
295 ** the trailing '\0' is there automatically as I allocated enough store
296 ** with MEMF_CLEAR
299 } /* while (FALSE == AllDone) */
302 ** Free the pattern since it has been distributed now
304 FreeMem(ParsedPattern, PatLength);
307 ** The AnchorChain to work with is the second one.
309 AP->ap_Base = AP->ap_Base->an_Child;
310 AC = AP->ap_Base;
312 AC->an_Lock = firstlock;
314 (void)Examine(AC->an_Lock, &AC->an_Info);
316 return followpattern(AP, AC, DOSBase);
318 } /* if (NULL != ParsedPattern) */
319 else
321 return ERROR_NO_FREE_STORE;
324 return 0;
326 AROS_LIBFUNC_EXIT
328 } /* MatchFirst */
335 matchnext.c:
344 (C) 1995-96 AROS - The Amiga Research OS
345 $Id$
347 Desc:
348 Lang: english
350 #include <exec/memory.h>
351 #include <exec/types.h>
352 #include <dos/dos.h>
353 #include <proto/exec.h>
354 #include "dos_intern.h"
356 /*****************************************************************************
358 NAME */
359 #include <dos/dosasl.h>
360 #include <proto/dos.h>
362 AROS_LH1(LONG, MatchNext,
364 /* SYNOPSIS */
365 AROS_LHA(struct AnchorPath *, AP, D1),
367 /* LOCATION */
368 struct DosLibrary *, DOSBase, 138, Dos)
370 /* FUNCTION
371 Find next file or directory that matches a given pattern.
372 See <dos/dosasl.h> for more docs and how to control MatchNext().
375 INPUTS
376 AP - pointer to Anchor Path structure which had been passed to
377 MatchFirst() before.
379 RESULT
381 NOTES
383 EXAMPLE
385 BUGS
386 Copying of the relative path to ap_Buf is not implemented yet
389 SEE ALSO
390 MatchFirst() MatchEnd() CurrentDir() Examine() ExNext()
391 ParsePattern() <dos/dosasl.h>
393 INTERNALS
395 *****************************************************************************/
397 AROS_LIBFUNC_INIT
398 AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
401 ** If the user says I am supposed to enter the directory then I first check
402 ** whether it is a directory...
405 struct AChain * AC = AP->ap_Current;
406 BOOL success;
407 struct Task * task = FindTask(NULL);
409 bug("matchnext\n");
411 AP->ap_BreakBits &= (SIGBREAKF_CTRL_C|
412 SIGBREAKF_CTRL_D|
413 SIGBREAKF_CTRL_E|
414 SIGBREAKF_CTRL_F);
416 if (0 != (AP->ap_Flags & APF_DODIR ))
418 bug("matchnext: APF_DODIR is set\n");
419 if (AC->an_Info.fib_DirEntryType >= 0 /* &&
420 AC->an_Info.fib_DirEntryType != ST_SOFTLINK */)
422 bug("matchnext: APF_DODIR is set. Is a directory.\n");
424 /* Ok, it seems to be a directory so I will enter it. */
425 /* See whether there's a AnchorChain for that dir... */
426 if (NULL == AC->an_Child)
428 bug("matchnext: APF_DODIR is set. Is a directory. Has no child. Creating temp AChain\n");
429 AC->an_Child = (struct AChain *)
430 AllocVec(sizeof(struct AChain)+1, MEMF_CLEAR);
432 if (AC->an_Child)
434 AC->an_Child->an_Parent = AC;
436 AC->an_Child->an_String[0] = P_ANY;
437 AC->an_Child->an_Flags = DDF_PatternBit;
440 bug("matchnext: Created temporary AChain structure: %x!\n", AC->an_Child);
443 if (NULL != AC->an_Child)
445 BPTR newdir;
447 bug("matchnext: APF_DODIR is set. Is a directory. Has child.\n");
449 /* Ok, we're all set. */
450 /* Lock the director by it's name. */
451 AP->ap_Current = AC->an_Child;
453 bug("matchnext: APF_DODIR is set. Is a directory. Has child. Locking \"%s\"\n", AC->an_Info.fib_FileName);
455 newdir = Lock(AC->an_Info.fib_FileName, ACCESS_READ);
456 bug("matchnext: APF_DODIR is set. Is a directory. Has child. Lock = %x\n", newdir);
458 if (!newdir) /* stegerg */
460 AC = AC->an_Child;
461 return IoErr();
462 } /* end stegerg */
464 //kprintf("CurrentDir()ing %x\n",AC->an_Info.fib_FileName);
465 (void)CurrentDir(newdir);
466 bug("matchnext: APF_DODIR is set. Is a directory. Has child. CurrentDir()ed to lock\n");
468 AC = AC->an_Child;
469 AC->an_Lock = newdir;
470 bug("matchnext: APF_DODIR is set. Is a directory. Has child. Calling Examine\n");
471 Examine(AC->an_Lock, &AC->an_Info);
472 bug("matchnext: APF_DODIR is set. Is a directory. Has child. Called Examine\n");
474 else
476 bug("matchnext: APF_DODIR is set. Could not alloc temp AChain. Returnin ERROR_NO_FREE_STORE\n");
477 return ERROR_NO_FREE_STORE;
480 } /* if (AC->an_Info.fib_DirEntryType >= 0 ... */
482 } /* if (0 != (AP->ap_Flags & APF_DODIR )) */
484 AP->ap_Flags &= ~(BYTE)(APF_DODIR|APF_DIDDIR);
486 bug("matchnext 2\n");
489 ** AC points to the current AnchorChain
491 while (TRUE)
495 ULONG breakbits;
497 ** Check for a break signal CTRL C/D/E/F
499 breakbits = (AP->ap_BreakBits & SetSignal(0, 0)); /* task->tc_SigRecvd */
501 if (0 != breakbits)
504 ** Finish right here... there might be a problem when/if the
505 ** algorithm is resumed the next time... Gotta test that.
507 AP->ap_FoundBreak = breakbits;
508 bug("matchnext 2: break bits were set. Returning ERROR_BREAK\n");
510 return ERROR_BREAK;
513 success = ExNext (AC->an_Lock, &AC->an_Info);
516 while (DOSTRUE == success &&
517 DOSFALSE == MatchPatternNoCase(AC->an_String,
518 AC->an_Info.fib_FileName));
521 if (DOSFALSE == success)
523 bug("matchnext 2: success == DOSFALSE (no matching file)\n");
525 ** No more entries in this dir that match. So I might have to
526 ** step back one directory. Unlock the current dir first.
529 //kprintf("Couldn't find a matching file.!\n");
531 if (AP->ap_Base == AC)
533 bug("matchnext 2: success == DOSFALSE (no matching file). Unlocking %x\n", AC->an_Lock);
534 UnLock(AC->an_Lock);
535 AP->ap_Current = AC->an_Parent;
536 bug("matchnext 2: success == DOSFALSE (no matching file). AP->ap_Current = %x\n", AP->ap_Current);
537 bug("matchnext 2: currentdiring to %x\n", AP->ap_Current->an_Lock);
538 CurrentDir(AP->ap_Current->an_Lock); /* stegerg */
539 bug("matchnext 2: Cannot step back dir. Returning ERROR_NO_MORE_ENTRIES\n");
540 return ERROR_NO_MORE_ENTRIES;
544 ** Are there any previous directories???
546 if (NULL != AC && NULL != AC->an_Parent)
548 LONG retval = 0;
550 bug("matchnext 2: success == DOSFALSE. There is a Parent and AC is *not* NULL. Unlocking %x\n", AC->an_Lock);
552 UnLock(AC->an_Lock);
553 AC->an_Lock = NULL;
555 AC = AC->an_Parent;
556 AP->ap_Current = AC;
558 bug("matchnext 2: success == DOSFALSE. There is a Parent and AC is *not* NULL. CurrentDir()ing %x\n", AC->an_Lock);
560 CurrentDir(AC->an_Lock);
562 if (AC->an_Child->an_Flags & DDF_PatternBit)
564 FreeVec(AC->an_Child);
565 AC->an_Child = NULL;
567 else
568 if (0 == (AC->an_Flags & DDF_PatternBit))
571 ** In this case I must silently follow the pattern again...
573 bug("matchnext 2: success == DOSFALSE. DDF_PatternBit is *not* set. Leaving matchnext with result from followpattern()\n");
574 return followpattern(AP, AC, DOSBase);
577 AP->ap_Flags |= APF_DIDDIR;
579 ** I show this dir again as I come back from searching it
582 retval = createresult(AP, AC, DOSBase);
585 ** Step back to this directory and go on searching here
588 CurrentDir(AC->an_Lock);
590 if (NULL == AC->an_Parent)
591 retval = ERROR_NO_MORE_ENTRIES;
593 bug("matchnext 2: returning retval\n", retval);
595 return retval;
597 } /* if (NULL != AC->an_Parent && NULL != AC) */
599 bug("matchnext 2: success == DOSFALSE. There is no Parent and/or AC is NULL. Returning ERROR_NO_MORE_ENTRIES\n");
602 ** No previous directory, so I am done here...
604 return ERROR_NO_MORE_ENTRIES;
606 } /* if (DOSFALSE == success) */
607 else
609 bug("matchnext 2: success == DOSTRUE (found a match). Leaving matchnext wth result from createresult()\n");
610 /* Alright, I found a match... */
611 return createresult(AP, AC, DOSBase);
614 } /* while (TRUE) */
616 bug("matchnext 2: returning 0.\n");
618 return 0;
620 AROS_LIBFUNC_EXIT
622 } /* MatchNext */
628 matchend.c:
636 (C) 1995-96 AROS - The Amiga Research OS
637 $Id$
639 Desc:
640 Lang: english
642 #include <proto/exec.h>
643 #include "dos_intern.h"
645 /*****************************************************************************
647 NAME */
648 #include <dos/dosasl.h>
649 #include <proto/dos.h>
651 AROS_LH1(void, MatchEnd,
653 /* SYNOPSIS */
654 AROS_LHA(struct AnchorPath *, AP, D1),
656 /* LOCATION */
657 struct DosLibrary *, DOSBase, 139, Dos)
659 /* FUNCTION
660 Free the memory that was allocated by calls to MatchFirst() and
661 MatchNext()
663 INPUTS
664 AP - pointer to Anchor Path structure which had been passed to
665 MatchFirst() before.
667 RESULT
668 Allocated memory is returned and filelocks are freed.
670 NOTES
672 EXAMPLE
674 BUGS
676 SEE ALSO
678 INTERNALS
680 *****************************************************************************/
682 AROS_LIBFUNC_INIT
683 AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
685 /* Free the AChain and unlock all locks that are still there */
686 struct AChain * AC = AP->ap_Current;
687 struct AChain * AC_tmp;
689 /* Unlock everything */
690 if (NULL == AC)
691 return;
693 while (NULL != AC->an_Parent)
695 bug("MatchEnd: unlocking %x\n", AC->an_Lock);
696 UnLock(AC->an_Lock);
697 AC = AC->an_Parent;
700 bug("MatchEnd: CurrentDir(%x)\n", AC->an_Lock);
702 CurrentDir(AC->an_Lock);
704 /* AC points to the very first AChain obj. in the list */
705 /* Free the AChain List */
706 while (NULL != AC)
708 AC_tmp = AC->an_Child;
709 FreeVec(AC);
710 AC = AC_tmp;
713 /* Cleanup AP */
714 AP->ap_Base = NULL;
715 AP->ap_Current = NULL;
717 AROS_LIBFUNC_EXIT
719 } /* MatchEnd */
729 match_misc.c:
731 #include <exec/types.h>
732 #include <proto/exec.h>
733 #include <proto/dos.h>
734 #include <dos/dosasl.h>
735 #include "dos_intern.h"
736 #include <string.h>
738 LONG followpattern(struct AnchorPath * AP,
739 struct AChain * AC,
740 struct DosLibrary * DOSBase)
742 LONG success;
744 bug("followpattern start\n");
747 ** If the user specified the pattern libs:#?/s#/
748 ** then I must enter that pattern before I return to the user.
750 while (TRUE)
754 success = ExNext (AC->an_Lock, &AC->an_Info);
756 while (DOSTRUE == success &&
757 DOSFALSE == MatchPatternNoCase(AC->an_String,
758 AC->an_Info.fib_FileName));
761 ** If no matching entry could be found here then I
762 ** step back one directory, unless this is the very
763 ** first directory already.
765 if (DOSFALSE == success)
767 bug("followpattern: success is DOSFALSE. Unlocking AC->an_Lock %x\n", AC->an_Lock);
768 UnLock(AC->an_Lock);
769 AC->an_Lock = NULL;
771 AC = AC->an_Parent;
772 bug("followpattern: success is DOSFALSE. AC now %x\n", AC);
774 AP->ap_Current = AC;
776 bug("followpattern: success is DOSFALSE. CurrentDir()ing to %x\n", AC->an_Lock);
778 CurrentDir(AC->an_Lock);
780 bug("followpattern: success is DOSFALSE. AC has parent = %s\n", AC->an_Parent ? "yes" : "no");
782 if (NULL == AC->an_Parent)
784 bug("followpattern: success is DOSFALSE. Has no parent. --> returning ERROR_NO_MORE_ENTRIES\n");
785 return ERROR_NO_MORE_ENTRIES;
788 else
790 bug("followpattern: success *not* DOSFALSE.\n");
791 if (AC->an_Info.fib_DirEntryType >= 0 /* &&
792 AC->an_Info.fib_DirEntryType != ST_SOFTLINK */)
794 bug("followpattern: success *not* DOSFALSE. Is a directory.\n");
796 ** I must silently enter this directory if there
797 ** are further patterns left, otherwise I return to the
798 ** user.
800 if (NULL != AC->an_Child)
803 ** Silently entering this dir according to the
804 ** pattern.
806 BPTR newdir;
808 bug("followpattern: success *not* DOSFALSE. Is a directory. Has a child. Entering\n");
810 AP->ap_Current = AC->an_Child;
812 bug("followpattern: success *not* DOSFALSE. Is a directory. Locking + CurrentDir()ing to %s\n", AC->an_Info.fib_FileName);
814 newdir = Lock(AC->an_Info.fib_FileName, ACCESS_READ);
815 bug("followpattern: success *not* DOSFALSE. Is a directory. Locking done. Lock = %x\n", newdir);
816 (void)CurrentDir(newdir);
818 bug("followpattern: success *not* DOSFALSE. Is a directory. CurrentDir()ing done\n");
820 AC = AC->an_Child;
821 AC->an_Lock = newdir;
823 bug("followpattern: success *not* DOSFALSE. Is a directory. Examining lock %x\n", newdir);
825 Examine(AC->an_Lock, &AC->an_Info);
826 bug("followpattern: success *not* DOSFALSE. Is a directory. Examining lock done\n");
828 else
830 bug("followpattern: success *not* DOSFALSE. Is a directory. Has now child. Leaving followpattern with result from createresult\n");
832 ** Ask the user whether to enter this dir or not
834 return createresult(AP, AC, DOSBase);
837 } /* is a directory */
838 else
841 ** This is a file. If there is pattern left to match then
842 ** I must not show this file because I must fulfill the pattern
843 ** first.
845 if (NULL == AC->an_Child)
847 bug("followpattern: is a file and has no child: leaving followpattern with result from createresult \n");
850 ** There's no pattern left!
852 return createresult(AP, AC, DOSBase);
854 else
855 bug("followpattern: Silently skipping file %s!\n",AC->an_Info.fib_FileName);
857 } /* is a file */
859 } /* if (DOSFALSE == success) */
861 } /* while (TRUE) */
863 #if 0
865 ** Hooray! A matching file was found. Also show the data in AP
867 createresult(AP, AC, DOSBase);
868 #endif
874 ** A file/directory has been found and now it must be written
875 ** into the relevant structures.
877 LONG createresult(struct AnchorPath * AP,
878 struct AChain * AC,
879 struct DosLibrary * DOSBase)
881 bug("createresult\n");
883 CopyMem(&AC->an_Info, &AP->ap_Info, sizeof(struct FileInfoBlock));
884 if (0 != AP->ap_Strlen)
886 if (FALSE == writeFullPath(AP))
888 bug("createresult: returning ERROR_BUFFER_OVERFLOW\n");
889 return ERROR_BUFFER_OVERFLOW;
893 bug("createresult: done\n");
895 return 0;
899 /* Function needed by MatchFirst/Next */
901 BOOL writeFullPath(struct AnchorPath * AP)
903 struct AChain * AC = AP->ap_Base;
904 BOOL end = FALSE;
905 char * LastPos = (char *)&AP->ap_Buf;
906 int copied = 0;
908 bug("writefullpath\n");
909 while (FALSE == end)
911 int len = strlen(AC->an_Info.fib_FileName);
912 if (copied+len > AP->ap_Strlen)
914 bug("writefullpath: not enough space\n");
915 return FALSE;
917 strcpy(&LastPos[copied], AC->an_Info.fib_FileName);
918 copied += len;
920 if (AC != AP->ap_Current)
922 /* also add a '/' */
923 if (copied+1 > AP->ap_Strlen)
925 bug("writefullpath: not enough space 2\n");
926 return FALSE;
928 LastPos[copied]='/';
929 copied++;
931 else
933 if (copied+1 > AP->ap_Strlen)
935 bug("writefullpath: not enough space 3\n");
936 return FALSE;
938 LastPos[copied]='\0';
939 end = TRUE;
942 AC = AC->an_Child;
945 bug("writefullpath: done\n");
947 return TRUE;