~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to lib/cycle-check.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* help detect directory cycles efficiently
2
2
 
3
 
   Copyright (C) 2003-2006, 2009-2011 Free Software Foundation, Inc.
 
3
   Copyright (C) 2003-2006, 2009-2012 Free Software Foundation, Inc.
4
4
 
5
5
   This program is free software: you can redistribute it and/or modify
6
6
   it under the terms of the GNU General Public License as published by
50
50
   descending chdir call, with SB corresponding to the chdir operand.
51
51
   If SB corresponds to a directory that has already been seen,
52
52
   return true to indicate that there is a directory cycle.
53
 
   Note that this is done `lazily', which means that some of
 
53
   Note that this is done "lazily", which means that some of
54
54
   the directories in the cycle may be processed twice before
55
55
   the cycle is detected.  */
56
56
 
65
65
  if (state->chdir_counter && SAME_INODE (*sb, state->dev_ino))
66
66
    return true;
67
67
 
68
 
  /* If the number of `descending' chdir calls is a power of two,
 
68
  /* If the number of "descending" chdir calls is a power of two,
69
69
     record the dev/ino of the current directory.  */
70
70
  if (is_zero_or_power_of_two (++(state->chdir_counter)))
71
71
    {