mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
17e5214663
git-svn-id: file:///svn/toku/tokudb@11223 c7de825b-a66e-492c-adef-691d508d4ae1
22 lines
823 B
C
22 lines
823 B
C
#ident "$Id$"
|
|
#ident "Copyright (c) 2007, 2008, 2009 Tokutek Inc. All rights reserved."
|
|
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
|
|
|
// Clip horizontally (100 chars by default)
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
int main (int argc, char *argv[]) {
|
|
int targcol=100;
|
|
int c;
|
|
int col=0;
|
|
if (argc>1) {
|
|
targcol=atoi(argv[1]);
|
|
}
|
|
while ((c=getchar())!=EOF) {
|
|
if (c=='\n') { col=0; putchar(c); }
|
|
else if (col==targcol) { col++; printf("..."); }
|
|
else if (col>targcol) { col++; }
|
|
else { col++; putchar(c); }
|
|
}
|
|
return 0;
|
|
}
|