All pastes #984104 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-04-13 22:46 UTC
rendered paste body
#define GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>

// by dexen deVries

/* */
#define d *p

int main( int c, char *d ) {
	for ( ++p; d; ++p ) {
		if ( (d = realpath( d, !c )) == !c ) {
			perror( "realpath()" );
			return c;
		}
		printf( "%s%c", d, '\n'*(c!=2) );
		free( d );
	}
	return d;
}